Skip to content

Commit 05ee4fd

Browse files
committed
Fix embed kernel (taken from #1322)
1 parent e8222a6 commit 05ee4fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ipykernel/embed.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ def embed_kernel(module=None, local_ns=None, **kwargs):
4949
if module is None:
5050
module = caller_module
5151
if local_ns is None:
52-
local_ns = caller_locals
52+
local_ns = dict(**caller_locals)
5353

5454
app.kernel.user_module = module
55+
assert isinstance(local_ns, dict)
5556
app.kernel.user_ns = local_ns
5657
app.shell.set_completer_frame() # type:ignore[union-attr]
5758
app.start()

0 commit comments

Comments
 (0)