From e1cf2c324e62a455fde6c7b23d7697f13c8907e6 2011-12-10 22:20:30 From: Thomas Kluyver Date: 2011-12-10 22:20:30 Subject: [PATCH] Correct decisions about when to automatically get local namespace and module for embedding. --- diff --git a/IPython/frontend/terminal/embed.py b/IPython/frontend/terminal/embed.py index a11b960..a4359d6 100644 --- a/IPython/frontend/terminal/embed.py +++ b/IPython/frontend/terminal/embed.py @@ -175,9 +175,9 @@ class InteractiveShellEmbed(TerminalInteractiveShell): if local_ns is None or module is None: call_frame = sys._getframe(stack_depth).f_back - if local_ns is None and not self.default_user_ns: + if local_ns is None and self.default_user_ns: local_ns = call_frame.f_locals - if module is None and not self.default_user_module: + if module is None and self.default_user_module: global_ns = call_frame.f_globals module = sys.modules[global_ns['__name__']]