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