Ticket #5936: pythonstartup.patch

File pythonstartup.patch, 1.4 KB (added by Todd O'Bryan, 17 years ago)
  • django/core/management/commands/shell.py

    Property changes on: .
    ___________________________________________________________________
    Name: svn:ignore
       - build
    dist
    *.egg-info
    MANIFEST
    *.pyc
    
       + build
    dist
    *.egg-info
    MANIFEST
    *.pyc
    .settings
    .project
    .pydevproject
    
    
     
    4747
    4848            # We want to honor both $PYTHONSTARTUP and .pythonrc.py, so follow system
    4949            # 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                 # This will import .pythonrc.py as a side-effect
    58                 import user
     50            pythonrc = os.environ.get("PYTHONSTARTUP")
     51            if pythonrc and os.path.isfile(pythonrc):
     52                try:
     53                    execfile(pythonrc)
     54                except NameError:
     55                    pass
     56            # This will import .pythonrc.py as a side-effect
     57            import user
    5958            code.interact(local=imported_objects)
Back to Top