Ticket #3381: pythonstartup.diff
File pythonstartup.diff, 1.1 KB (added by , 17 years ago) |
---|
-
django/core/management/commands/shell.py
1 import os 1 2 from django.core.management.base import NoArgsCommand 2 3 from optparse import make_option 3 4 … … 43 44 import rlcompleter 44 45 readline.set_completer(rlcompleter.Completer(imported_objects).complete) 45 46 readline.parse_and_bind("tab:complete") 47 48 # We want to honor both $PYTHONSTARTUP and .pythonrc.py, so follow system 49 # conventions and get $PYTHONSTARTUP first then import user. 50 if not use_plain: 51 pythonrc = os.environ.get("PYTHONSTARTUP") 52 if pythonrc and os.path.isfile(pythonrc): 53 try: 54 execfile(pythonrc) 55 except NameError: 56 pass 57 import user 46 58 code.interact(local=imported_objects)