Revision: 2951
Author: jprantan
Date: Tue Apr 13 04:33:28 2010
Log: Fixed problem which caused framework error to occur with uk timeouts. Issue 520.
http://code.google.com/p/robotframework/source/detail?r=2951

Modified:
 /trunk/src/robot/running/userkeyword.py

=======================================
--- /trunk/src/robot/running/userkeyword.py     Mon Apr 12 03:23:02 2010
+++ /trunk/src/robot/running/userkeyword.py     Tue Apr 13 04:33:28 2010
@@ -131,14 +131,19 @@

     def run(self, output, namespace, arguments):
         namespace.start_user_keyword(self)
-        variables = namespace.variables
-        postional, named = self._arguments.set_to(variables, arguments)
-        self._tracelog_args(output, postional, named)
+        try:
+            return self._run(output, namespace, arguments)
+        finally:
+            namespace.end_user_keyword()
+
+    def _run(self, output, namespace, arguments):
+ positional, named = self._arguments.set_to(namespace.variables, arguments)
+        self._tracelog_args(output, positional, named)
         self._verify_keyword_is_valid()
         self.timeout.start()
-        self._run_kws(output, namespace)
-        ret = self._get_return_value(variables)
-        namespace.end_user_keyword()
+        for kw in self.keywords:
+            kw.run(output, namespace)
+        ret = self._get_return_value(namespace.variables)
         output.trace('Return: %s' % utils.unic(ret))
         return ret

@@ -150,14 +155,6 @@
             raise DataError("User keyword '%s' contains no keywords"
                             % self.name)

-    def _run_kws(self, output, namespace):
-        for kw in self.keywords:
-            try:
-                kw.run(output, namespace)
-            except ExecutionFailed:
-                namespace.end_user_keyword()
-                raise
-
     def _get_return_value(self, variables):
         if not self.return_value:
             return None


--
To unsubscribe, reply using "remove me" as the subject.

Reply via email to