Author: jprantan
Date: Fri Jan  9 02:37:35 2009
New Revision: 1239

Modified:
   trunk/robot_postinstall.py

Log:
Fix for issue 196.

Modified: trunk/robot_postinstall.py
==============================================================================
--- trunk/robot_postinstall.py  (original)
+++ trunk/robot_postinstall.py  Fri Jan  9 02:37:35 2009
@@ -69,7 +69,15 @@

 def _get_installation_dir():
     """Returns installation location. Works also with easy_install."""
-    import robot
+    try:
+        import robot
+    except:
+        # See http://code.google.com/p/robotframework/issues/detail?id=196
+        class FakeModule:
+            def __getattr(self, name):
+ raise RuntimeError('Fake module set by robot_postinstall.py')
+        sys.modules['urllib'] = FakeModule()
+        import robot
     return os.path.dirname(os.path.abspath(robot.__file__))

def _update_scripts(scripts, script_dir, robot_dir, python_exe=sys.executable):

Reply via email to