Skip to content

Commit 7a6d460

Browse files
authored
Copy scope.client reference as well (#3857)
1 parent 5a09770 commit 7a6d460

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

sentry_sdk/scope.py

+1
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ def __copy__(self):
225225
rv = object.__new__(self.__class__) # type: Scope
226226

227227
rv._type = self._type
228+
rv.client = self.client
228229
rv._level = self._level
229230
rv._name = self._name
230231
rv._fingerprint = self._fingerprint

tests/test_scope.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
)
2020

2121

22-
SLOTS_NOT_COPIED = {"client"}
23-
"""__slots__ that are not copied when copying a Scope object."""
24-
25-
2622
def test_copying():
2723
s1 = Scope()
2824
s1.fingerprint = {}
@@ -43,7 +39,7 @@ def test_all_slots_copied():
4339
scope_copy = copy.copy(scope)
4440

4541
# Check all attributes are copied
46-
for attr in set(Scope.__slots__) - SLOTS_NOT_COPIED:
42+
for attr in set(Scope.__slots__):
4743
assert getattr(scope_copy, attr) == getattr(scope, attr)
4844

4945

0 commit comments

Comments
 (0)