Skip to content

Commit 0a9df3f

Browse files
author
Bob Farrell
committed
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. committer: Bob Farrell <bob@keys.(none)>
1 parent 317a8a5 commit 0a9df3f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bpython.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,8 +795,9 @@ def repl( self ):
795795
filename = os.environ.get('PYTHONSTARTUP')
796796
if filename and os.path.isfile(filename):
797797
f = open(filename, 'r')
798-
self.interp.runsource(f.read())
798+
code_obj = compile(f.read(), filename, 'exec')
799799
f.close()
800+
self.interp.runcode(code_obj)
800801

801802
# The regular help() function uses PAGER to display the help, which
802803
# screws with bpython.

0 commit comments

Comments
 (0)