Skip to content

Commit 25ef93b

Browse files
committed
added __name__ to globals for jupyter sessions (set to global context name)
1 parent 77adcc6 commit 25ef93b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

custom_components/pyscript/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ async def jupyter_kernel_start(call):
121121
_LOGGER.debug("service call to jupyter_kernel_start: %s", call.data)
122122

123123
global_ctx_name = GlobalContextMgr.new_name("jupyter_")
124-
global_ctx = GlobalContext(global_ctx_name, global_sym_table={}, manager=GlobalContextMgr)
124+
global_ctx = GlobalContext(
125+
global_ctx_name, global_sym_table={"__name__": global_ctx_name}, manager=GlobalContextMgr
126+
)
125127
global_ctx.set_auto_start(True)
126128

127129
GlobalContextMgr.set(global_ctx_name, global_ctx)

0 commit comments

Comments
 (0)