mailr9348 - /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 August 21, 2009 - 10:50:
Author: bugman
Date: Fri Aug 21 10:50:08 2009
New Revision: 9348

URL: http://svn.gna.org/viewcvs/relax?rev=9348&view=rev
Log:
The execfile statement has been replaced with a call to the exec(compile()) 
function.

This was done with the python 2.x to 3.x script with the commands:
2to3 -w -f exec relax .

The change is in preparation for Python 3.0, and relax still works with 
Python versions 2.4, 2.5,
and 2.6.  The syntax has changed from:

execfile(script_file, local)

to:

exec(compile(open(script_file).read(), script_file, 'exec'), local)

Hmmm, not much of a language simplification!



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=9348&r1=9347&r2=9348&view=diff
==============================================================================
--- 1.3/prompt/interpreter.py (original)
+++ 1.3/prompt/interpreter.py Fri Aug 21 10:50:08 2009
@@ -430,7 +430,7 @@
 
     # Execute the script.
     try:
-        execfile(script_file, local)
+        exec(compile(open(script_file).read(), script_file, 'exec'), local)
 
     # Catch ctrl-C.
     except KeyboardInterrupt:




Related Messages


Powered by MHonArc, Updated Fri Aug 21 11:00:02 2009