Revision: 3281
Author: jprantan
Date: Wed May 12 06:09:52 2010
Log: Fix for issue 515.
http://code.google.com/p/robotframework/source/detail?r=3281

Modified:
 /trunk/src/robot/utils/importing.py

=======================================
--- /trunk/src/robot/utils/importing.py Tue Mar 23 04:15:41 2010
+++ /trunk/src/robot/utils/importing.py Wed May 12 06:09:52 2010
@@ -85,9 +85,17 @@
 def _import(name, type_):
     modname, classname, fromlist = _get_import_params(name)
     try:
- # It seems that we get class when importing java class from file system - # or from a default package of a jar file. Otherwise we get a module.
-        imported = __import__(modname, {}, {}, fromlist)
+        try:
+ # It seems that we get class when importing java class from file system + # or from a default package of a jar file. Otherwise we get a module.
+            imported = __import__(modname, {}, {}, fromlist)
+        except ImportError:
+            # Hack to support standalone Jython:
+            # http://code.google.com/p/robotframework/issues/detail?id=515
+            if not sys.platform.startswith('java'):
+                raise
+            __import__(name)
+            imported = __import__(modname, {}, {}, fromlist)
     except:
         _raise_import_failed(type_, name)
     try:

Reply via email to