File tree Expand file tree Collapse file tree 1 file changed +0
-10
lines changed Expand file tree Collapse file tree 1 file changed +0
-10
lines changed Original file line number Diff line number Diff line change @@ -102,25 +102,15 @@ def test_callback_py_object_none_return(self):
102
102
# bpo-36880: test that returning None from a py_object callback
103
103
# does not decrement the refcount of None.
104
104
105
- import sys
106
-
107
105
for FUNCTYPE in (ctypes .CFUNCTYPE , ctypes .PYFUNCTYPE ):
108
106
with self .subTest (FUNCTYPE = FUNCTYPE ):
109
107
@FUNCTYPE (ctypes .py_object )
110
108
def func ():
111
109
return None
112
110
113
111
# Check that calling func does not affect None's refcount.
114
- none_refcount = sys .getrefcount (None )
115
- # Because None's refcount can also change for other reasons,
116
- # we call func in a loop to ensure that any effects on None's
117
- # refcount are clearly visible.
118
112
for _ in range (10000 ):
119
113
func ()
120
- # Allow for small variations in None's refcount from other
121
- # sources.
122
- self .assertAlmostEqual (
123
- sys .getrefcount (None ), none_refcount , delta = 50 )
124
114
125
115
if __name__ == '__main__' :
126
116
unittest .main ()
You can’t perform that action at this time.
0 commit comments