Revision: 3992
Author: jussi.ao.malinen
Date: Mon Aug 30 06:46:18 2010
Log: use correct log message based on whether path is known.
http://code.google.com/p/robotframework/source/detail?r=3992

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

=======================================
--- /trunk/src/robot/variables/variables.py     Fri Aug 27 03:32:06 2010
+++ /trunk/src/robot/variables/variables.py     Mon Aug 30 06:46:18 2010
@@ -61,11 +61,11 @@
         if path:
             msg += " in file '%s'" % path
         msg += " before Robot Framework 2.6."
- # An ugly hack to get messages to log file when possible. log_message - # fails if writing XML hasn't started e.g. when processing Variable table
-        try:
+        # If path is not known we are executing keywords and can use
+        # log_message which will create also links.
+        if not path:
             LOGGER.log_message(Message(msg, 'WARN'))
-        except AttributeError:
+        else:
             LOGGER.warn(msg)

     def __getitem__(self, name):

Reply via email to