mirror of
https://github.com/kennethreitz-archive/bpython-gist.git
synced 2026-06-05 23:50:18 +00:00
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:
+2
-1
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user