Show More
@@ -186,6 +186,11 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 | class DummyMod(object): | |||
|
191 | "A dummy module used for IPython's interactive namespace." | |||
|
192 | pass | |||
|
193 | ||||
189 | #----------------------------------------------------------------------------- |
|
194 | #----------------------------------------------------------------------------- | |
190 | # Main IPython class |
|
195 | # Main IPython class | |
191 | #----------------------------------------------------------------------------- |
|
196 | #----------------------------------------------------------------------------- | |
@@ -1035,9 +1040,6 b' class InteractiveShell(SingletonConfigurable):' | |||||
1035 | """ |
|
1040 | """ | |
1036 | if user_module is None and user_ns is not None: |
|
1041 | if user_module is None and user_ns is not None: | |
1037 | user_ns.setdefault("__name__", "__main__") |
|
1042 | 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() |
|
1043 | user_module = DummyMod() | |
1042 | user_module.__dict__ = user_ns |
|
1044 | user_module.__dict__ = user_ns | |
1043 |
|
1045 |
@@ -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