Skip to content

Commit 8d6dfb4

Browse files
author
chengcong1
committed
adjust code
1 parent d5bd75a commit 8d6dfb4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

jupyter_server/base/call_context.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Copyright (c) Jupyter Development Team.
33
# Distributed under the terms of the Modified BSD License.
44

5-
import copy
65
from contextvars import Context, ContextVar, copy_context
76
from typing import Any
87

@@ -42,7 +41,6 @@ def get(cls, name: str) -> Any:
4241
The value associated with the named variable for this call context
4342
"""
4443
name_value_map = CallContext._get_map()
45-
4644
if name in name_value_map:
4745
return name_value_map[name]
4846
return None # TODO: should this raise `LookupError` (or a custom error derived from said)
@@ -62,7 +60,7 @@ def set(cls, name: str, value: Any) -> None:
6260
-------
6361
None
6462
"""
65-
name_value_map = copy.deepcopy(CallContext._get_map())
63+
name_value_map = CallContext._get_map().copy()
6664
name_value_map[name] = value
6765
CallContext._name_value_map.set(name_value_map)
6866

0 commit comments

Comments
 (0)