mailr12328 - /1.3/prompt/interpreter.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on January 13, 2011 - 16:59:
Author: bugman
Date: Thu Jan 13 16:59:12 2011
New Revision: 12328

URL: http://svn.gna.org/viewcvs/relax?rev=12328&view=rev
Log:
Fix for running scripts in certain versions of python.

If a file with the same name as the script lies in one of the paths in 
sys.path, then that file will
be executed rather than the script.  This affects only certain python 
versions.


Modified:
    1.3/prompt/interpreter.py

Modified: 1.3/prompt/interpreter.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/interpreter.py?rev=12328&r1=12327&r2=12328&view=diff
==============================================================================
--- 1.3/prompt/interpreter.py (original)
+++ 1.3/prompt/interpreter.py Thu Jan 13 16:59:12 2011
@@ -367,6 +367,10 @@
 
     # Execute the module.
     try:
+        # Reverse the system path so that the script path is first.
+        sys.path.reverse()
+
+        # Execute the script as a module.
         runpy.run_module(module, globals)
     finally:
         # Switch back to the original working directory.
@@ -374,6 +378,7 @@
             chdir(orig_dir)
 
         # Remove the script path.
+        sys.path.reverse()
         sys.path.pop(sys.path.index(script_path))
 
     # Unlock execution if needed.




Related Messages


Powered by MHonArc, Updated Thu Jan 13 17:00:02 2011