Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
AnastasiaSliusar committed Aug 5, 2024
1 parent ae37186 commit 4b04556
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions jupyter_server/services/sessions/sessionmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._pending_sessions = KernelSessionRecordList()

_custom_envs: Dict[str, str] = {}
_custom_envs: Dict[str, Optional[Dict[str, Any]]] = {}
# Session database initialized below
_cursor = None
_connection = None
Expand Down Expand Up @@ -481,10 +481,9 @@ async def update_session(self, session_id, **kwargs):

# if we have custom env than we have to add them to available env variables
if isinstance(self._custom_envs, dict):
if self._custom_envs[kernel_id] is not None and isinstance(
self._custom_envs[kernel_id], dict
):
for key, value in self._custom_envs[kernel_id].items():
custom_env = self._custom_envs.get(kernel_id)
if custom_env is not None and isinstance(custom_env, dict):
for key, value in custom_env.items():
env[key] = value

self.kernel_manager.update_env(kernel_id=kernel_id, env=env)
Expand Down

0 comments on commit 4b04556

Please sign in to comment.