Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3b47371

Browse files
authored
Set instance on singleton configurable when created via constructor. (#14169)
See #14164
2 parents ca7a5d0 + 2e91b09 commit 3b47371

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

IPython/terminal/embed.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ def __init__(self, **kw):
158158
assert (
159159
"user_global_ns" not in kw
160160
), "Key word argument `user_global_ns` has been replaced by `user_module` since IPython 4.0."
161+
# temporary fix for https://github.com/ipython/ipython/issues/14164
162+
cls = type(self)
163+
if cls._instance is None:
164+
for subclass in cls._walk_mro():
165+
subclass._instance = self
166+
cls._instance = self
161167

162168
clid = kw.pop('_init_location_id', None)
163169
if not clid:

0 commit comments

Comments
 (0)