Author: bugman Date: Thu Jan 13 16:59:54 2011 New Revision: 12329 URL: http://svn.gna.org/viewcvs/relax?rev=12329&view=rev Log: Merged revisions 12328 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r12328 | bugman | 2011-01-13 16:59:12 +0100 (Thu, 13 Jan 2011) | 6 lines 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: branches/bieri_gui/ (props changed) branches/bieri_gui/prompt/interpreter.py Propchange: branches/bieri_gui/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Thu Jan 13 16:59:54 2011 @@ -1,1 +1,1 @@ -/1.3:1-12320 +/1.3:1-12328 Modified: branches/bieri_gui/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/branches/bieri_gui/prompt/interpreter.py?rev=12329&r1=12328&r2=12329&view=diff ============================================================================== --- branches/bieri_gui/prompt/interpreter.py (original) +++ branches/bieri_gui/prompt/interpreter.py Thu Jan 13 16:59:54 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.