Ticket #12735: django_shell.patch

File django_shell.patch, 965 bytes (added by alperkanat, 15 years ago)
  • core/management/commands/shell.py

     
    2424                # Don't bother loading IPython, because the user wants plain Python.
    2525                raise ImportError
    2626            import IPython
    27             # Explicitly pass an empty list as arguments, because otherwise IPython
    28             # would use sys.argv from this script.
    29             shell = IPython.Shell.IPShell(argv=[])
     27            try:
     28                # Explicitly pass an empty list as arguments, because otherwise IPython
     29                # would use sys.argv from this script.
     30                shell = IPython.Shell.IPShell(argv=[])
     31            except AttributeError:
     32                shell = IPython.InteractiveShell()
    3033            shell.mainloop()
    3134        except ImportError:
    3235            import code
Back to Top