Skip to content

Commit

Permalink
Backport PR ipython#14169: Set instance on singleton configurable whe…
Browse files Browse the repository at this point in the history
…n created via constructor.
  • Loading branch information
Carreau authored and meeseeksmachine committed Sep 19, 2023
1 parent f27f110 commit 7a33e1b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions IPython/terminal/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ def __init__(self, **kw):
assert (
"user_global_ns" not in kw
), "Key word argument `user_global_ns` has been replaced by `user_module` since IPython 4.0."
# temporary fix for https://github.com/ipython/ipython/issues/14164
cls = type(self)
if cls._instance is None:
for subclass in cls._walk_mro():
subclass._instance = self
cls._instance = self

clid = kw.pop('_init_location_id', None)
if not clid:
Expand Down

0 comments on commit 7a33e1b

Please sign in to comment.