diff --git a/django/core/management/commands/shell.py b/django/core/management/commands/shell.py
index 9616902..0f6bd71 100644
a
|
b
|
class Command(NoArgsCommand):
|
24 | 24 | # Don't bother loading IPython, because the user wants plain Python. |
25 | 25 | raise ImportError |
26 | 26 | 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=[]) |
30 | | shell.mainloop() |
| 27 | try: |
| 28 | from IPython.core.ipapp import IPythonApp |
| 29 | # Explicitly pass an empty list as arguments, because otherwise |
| 30 | # IPython would use sys.argv from this script. |
| 31 | app = IPythonApp(argv=[]) |
| 32 | app.start() |
| 33 | except ImportError: |
| 34 | # try IPython API < 0.11 |
| 35 | shell = IPython.Shell.IPShell(argv=[]) |
| 36 | shell.mainloop() |
31 | 37 | except ImportError: |
32 | 38 | import code |
33 | 39 | # Set up a dictionary to serve as the environment for the shell, so |