Skip to content

Commit e093c14

Browse files
committed
Use copy function
1 parent 1f15e1f commit e093c14

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

sentry_sdk/flag_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def clear(self):
2727
self.buffer = []
2828
self.ip = 0
2929

30-
def copy(self):
30+
def __copy__(self):
3131
# type: () -> FlagBuffer
3232
buffer = FlagBuffer(capacity=self.capacity)
3333
buffer.buffer = copy(self.buffer)
@@ -64,6 +64,9 @@ def __init__(self, flag, result):
6464
self.flag = flag
6565
self.result = result
6666

67+
def __copy__(self):
68+
return Flag(self.flag, self.result)
69+
6770
@property
6871
def asdict(self):
6972
# type: () -> FlagData

sentry_sdk/scope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def __copy__(self):
251251

252252
rv._last_event_id = self._last_event_id
253253

254-
rv._flags = self.flags.copy()
254+
rv._flags = copy(self._flags)
255255

256256
return rv
257257

0 commit comments

Comments
 (0)