Revision: e559074ef008
Branch:   default
Author:   Pekka Klärck
Date:     Thu Jan 10 23:51:49 2013
Log:      Fixed `return ValueError` -> `raise ValueError` x2.

The returned exception was assigned to two variables which caused ValueError masking this problem.

This interesting snafu was actually found in Pygments:
https://bitbucket.org/birkenfeld/pygments-main/commits/6a48b74c726f4cb8eb85877da7d1b1979ef53464
http://code.google.com/p/robotframework/source/detail?r=e559074ef008

Modified:
 /src/robot/variables/variablesplitter.py

=======================================
--- /src/robot/variables/variablesplitter.py    Tue Mar  6 00:46:30 2012
+++ /src/robot/variables/variablesplitter.py    Thu Jan 10 23:51:49 2013
@@ -72,12 +72,12 @@
     def _find_variable(self, string):
         max_end_index = string.rfind('}')
         if max_end_index == -1:
-            return ValueError('No variable end found')
+            raise ValueError('No variable end found')
         if self._is_escaped(string, max_end_index):
             return self._find_variable(string[:max_end_index])
         start_index = self._find_start_index(string, 1, max_end_index)
         if start_index == -1:
-            return ValueError('No variable start found')
+            raise ValueError('No variable start found')
         return start_index, max_end_index

     def _find_start_index(self, string, start, end):

Reply via email to