Small problem with PYTHONSTARTUP execution fixed.

Changed the way it parses and executes the file so that it actually does
execute it now; not sure what the problem was before exactly but it's fixed
now.
This commit is contained in:
Bob Farrell
2008-08-25 12:52:48 +01:00
parent b43ba3da9d
commit 0c220f93de
+2 -1
View File
@@ -795,8 +795,9 @@ class Repl( object ):
filename = os.environ.get('PYTHONSTARTUP')
if filename and os.path.isfile(filename):
f = open(filename, 'r')
self.interp.runsource(f.read())
code_obj = compile(f.read(), filename, 'exec')
f.close()
self.interp.runcode(code_obj)
# The regular help() function uses PAGER to display the help, which
# screws with bpython.