ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is probably a bug in rosh. The rosh loader for the shell needs to import os and sys. In order to be 'clean', it then deletes os and sys.

Here's a patch that I think resolves this peculiarity (needs more testing):

diff -r 35d8b08984d6 shell.py
--- a/shell.py  Fri Jul 01 12:45:40 2011 -0700
+++ b/shell.py  Fri Jul 01 12:45:42 2011 -0700
@@ -10,6 +10,14 @@
 # import all symbols after initialization
 from rosh import *

+try:
+    cleanup_os = 'os' not in sys.modules
+    cleanup_sys = False
+except:
+    import sys
+    cleanup_os = 'os' not in sys.modules
+    cleanup_sys = True
+    
 import os, sys
 plugins = sys.argv[1:]

@@ -39,7 +47,9 @@
         del _f

 del plugins
-del sys
-del os
+if cleanup_sys:
+    del sys
+if cleanup_os:
+    del os
 del _roshrcp
 del _rosenv