Skip to content

Commit

Permalink
added __name__ to globals for jupyter sessions (set to global context…
Browse files Browse the repository at this point in the history
… name)
  • Loading branch information
craigbarratt committed Oct 14, 2020
1 parent 77adcc6 commit 25ef93b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/pyscript/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ async def jupyter_kernel_start(call):
_LOGGER.debug("service call to jupyter_kernel_start: %s", call.data)

global_ctx_name = GlobalContextMgr.new_name("jupyter_")
global_ctx = GlobalContext(global_ctx_name, global_sym_table={}, manager=GlobalContextMgr)
global_ctx = GlobalContext(
global_ctx_name, global_sym_table={"__name__": global_ctx_name}, manager=GlobalContextMgr
)
global_ctx.set_auto_start(True)

GlobalContextMgr.set(global_ctx_name, global_ctx)
Expand Down

0 comments on commit 25ef93b

Please sign in to comment.