Skip to content

Commit

Permalink
check env in kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
fecet committed Jun 21, 2023
1 parent 261af36 commit 623b2b3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jupyter_client/provisioning/local_provisioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,11 @@ async def pre_launch(self, **kwargs: Any) -> Dict[str, Any]:
km.hb_port = lpc.find_available_port(km.ip)
km.control_port = lpc.find_available_port(km.ip)
self.ports_cached = True

km.write_connection_file(jupyter_session=kwargs['env'].get("JPY_SESSION_NAME", ""))
if 'env' in kwargs:
jupyter_session = kwargs['env'].get("JPY_SESSION_NAME", "")
km.write_connection_file(jupyter_session=jupyter_session)
else:
km.write_connection_file()
self.connection_info = km.get_connection_info()

kernel_cmd = km.format_kernel_cmd(
Expand Down

0 comments on commit 623b2b3

Please sign in to comment.