Skip to content

Commit 4c12afd

Browse files
author
Bob Farrell
committed
PYTHONSTARTUP variable is no longer ignored
Olivier Grisel pointed out that bpython ignores the PYTHONSTARTUP variable. I never used it but the code was simple enough, cited here: http://docs.python.org/tut/node4.html#startup It's not much code at all, but let me know if it breaks anything (I don't see why it should). committer: Bob Farrell <bob@keys.(none)>
1 parent addea38 commit 4c12afd

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎bpython.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@
4444
import ConfigParser
4545
from bpython.formatter import BPythonFormatter
4646

47+
# XXX I don't ever use this feature so I'm hoping someone can
48+
# test it for me; as you can see it is simple enough, taken
49+
# directly from:
50+
# http://docs.python.org/tut/node4.html#startup
51+
# Let me know if it breaks
52+
filename = os.environ.get('PYTHONSTARTUP')
53+
if filename and os.path.isfile(filename):
54+
execfile(filename)
55+
##################################################
56+
4757
class Dummy( object ):
4858
pass
4959
OPTS = Dummy()

0 commit comments

Comments
 (0)