Ticket #3381: trunk-ibr-pystartup-20070128-2331.diff

File trunk-ibr-pystartup-20070128-2331.diff, 844 bytes (added by Baurzhan Ismagulov <ibr@…>, 17 years ago)
  • django/core/management.py

    diff -Naurp trunk.orig/django/core/management.py trunk-pystartup/django/core/management.py
    old new def run_shell(use_plain=False):  
    11941194            # we already know 'readline' was imported successfully.
    11951195            import rlcompleter
    11961196            readline.parse_and_bind("tab:complete")
    1197         code.interact()
     1197        console = code.InteractiveConsole()
     1198        filename = os.environ.get("PYTHONSTARTUP")
     1199        if filename and os.path.isfile(filename):
     1200            source = open(filename, "r").read()
     1201            code=compile(source, filename, "exec")
     1202            console.runcode(code)
     1203        console.interact()
    11981204run_shell.args = '[--plain]'
    11991205
    12001206def dbshell():
Back to Top