From a5fce828f350ade841873824f8fb6a9c5581c0da Mon Sep 17 00:00:00 2001 From: Bob Farrell Date: Mon, 16 Jun 2008 22:40:55 +0100 Subject: [PATCH] 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). --- bpython.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bpython.py b/bpython.py index 31913bd..4c805df 100644 --- a/bpython.py +++ b/bpython.py @@ -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()