Ticket #18204: embed-ipython-module.2.diff

File embed-ipython-module.2.diff, 647 bytes (added by Alex Ogier, 13 years ago)
  • django/core/management/commands/shell.py

    diff --git a/django/core/management/commands/shell.py b/django/core/management/commands/shell.py
    index 26cbd7f..3c2b8e9 100644
    a b class Command(NoArgsCommand):  
    1313
    1414    def ipython(self):
    1515        try:
    16             from IPython import embed
    17             embed()
     16            # embed() needs to run in its own global context. See #18204
     17            exec "from IPython import embed; embed()" in globals()
    1818        except ImportError:
    1919            # IPython < 0.11
    2020            # Explicitly pass an empty list as arguments, because otherwise
Back to Top