From 0c220f93de839255cfa276e9c74cd89ee85d5771 Mon Sep 17 00:00:00 2001 From: Bob Farrell Date: Mon, 25 Aug 2008 12:52:48 +0100 Subject: [PATCH] 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. --- bpython.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bpython.py b/bpython.py index 8f0260f..8ff5267 100644 --- a/bpython.py +++ b/bpython.py @@ -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.