##// END OF EJS Templates
Merge pull request #4186 from mmckerns/master...
Thomas Kluyver -
r12492:a96f9c49 merge
parent child Browse files
Show More
@@ -186,6 +186,13 b' class ReadlineNoRecord(object):'
186 ghi = self.shell.readline.get_history_item
186 ghi = self.shell.readline.get_history_item
187 return [ghi(x) for x in range(start, end)]
187 return [ghi(x) for x in range(start, end)]
188
188
189
190 @undoc
191 class DummyMod(object):
192 """A dummy module used for IPython's interactive module when
193 a namespace must be assigned to the module's __dict__."""
194 pass
195
189 #-----------------------------------------------------------------------------
196 #-----------------------------------------------------------------------------
190 # Main IPython class
197 # Main IPython class
191 #-----------------------------------------------------------------------------
198 #-----------------------------------------------------------------------------
@@ -1035,9 +1042,6 b' class InteractiveShell(SingletonConfigurable):'
1035 """
1042 """
1036 if user_module is None and user_ns is not None:
1043 if user_module is None and user_ns is not None:
1037 user_ns.setdefault("__name__", "__main__")
1044 user_ns.setdefault("__name__", "__main__")
1038 class DummyMod(object):
1039 "A dummy module used for IPython's interactive namespace."
1040 pass
1041 user_module = DummyMod()
1045 user_module = DummyMod()
1042 user_module.__dict__ = user_ns
1046 user_module.__dict__ = user_ns
1043
1047
@@ -29,6 +29,7 b' import warnings'
29
29
30 from IPython.core import ultratb, compilerop
30 from IPython.core import ultratb, compilerop
31 from IPython.core.magic import Magics, magics_class, line_magic
31 from IPython.core.magic import Magics, magics_class, line_magic
32 from IPython.core.interactiveshell import DummyMod
32 from IPython.terminal.interactiveshell import TerminalInteractiveShell
33 from IPython.terminal.interactiveshell import TerminalInteractiveShell
33 from IPython.terminal.ipapp import load_default_config
34 from IPython.terminal.ipapp import load_default_config
34
35
@@ -185,9 +186,6 b' class InteractiveShellEmbed(TerminalInteractiveShell):'
185 there is no fundamental reason why it can't work perfectly."""
186 there is no fundamental reason why it can't work perfectly."""
186
187
187 if (global_ns is not None) and (module is None):
188 if (global_ns is not None) and (module is None):
188 class DummyMod(object):
189 """A dummy module object for embedded IPython."""
190 pass
191 warnings.warn("global_ns is deprecated, use module instead.", DeprecationWarning)
189 warnings.warn("global_ns is deprecated, use module instead.", DeprecationWarning)
192 module = DummyMod()
190 module = DummyMod()
193 module.__dict__ = global_ns
191 module.__dict__ = global_ns
General Comments 0
You need to be logged in to leave comments. Login now