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).
This commit is contained in:
Bob Farrell
2008-06-16 22:40:55 +01:00
parent 72376f7790
commit a5fce828f3
+10
View File
@@ -44,6 +44,16 @@ import fcntl
import ConfigParser
from bpython.formatter import BPythonFormatter
# XXX I don't ever use this feature so I'm hoping someone can
# test it for me; as you can see it is simple enough, taken
# directly from:
# http://docs.python.org/tut/node4.html#startup
# Let me know if it breaks
filename = os.environ.get('PYTHONSTARTUP')
if filename and os.path.isfile(filename):
execfile(filename)
##################################################
class Dummy( object ):
pass
OPTS = Dummy()