Skip to content

Commit

Permalink
Backport PR #14169 on branch 8.12.x (Set instance on singleton config…
Browse files Browse the repository at this point in the history
…urable when created via constructor.) (#14170)

Backport PR #14169: Set instance on singleton configurable when created
via constructor.
  • Loading branch information
Carreau authored Sep 27, 2023
2 parents f27f110 + 7a33e1b commit 1f69789
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 1f69789

Please sign in to comment.