Skip to content

Commit f5f296c

Browse files
committed
improve test_copy_reduce and test_deepcopy_reduce coverage
1 parent 5625b18 commit f5f296c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Lib/test/test_copy.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ class C(object):
7373
def __reduce__(self):
7474
c.append(1)
7575
return ""
76+
def __getattribute__(self, name):
77+
if name == "__reduce_ex__":
78+
raise AttributeError(name)
79+
return object.__getattribute__(self, name)
7680
c = []
7781
x = C()
7882
y = copy.copy(x)
@@ -342,6 +346,10 @@ class C(object):
342346
def __reduce__(self):
343347
c.append(1)
344348
return ""
349+
def __getattribute__(self, name):
350+
if name == "__reduce_ex__":
351+
raise AttributeError(name)
352+
return object.__getattribute__(self, name)
345353
c = []
346354
x = C()
347355
y = copy.deepcopy(x)

0 commit comments

Comments
 (0)