File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 210210 ctypes = None
211211from test .support import (cpython_only ,
212212 check_impl_detail , requires_debug_ranges ,
213- gc_collect , Py_GIL_DISABLED )
213+ gc_collect , Py_GIL_DISABLED , late_deletion )
214214from test .support .script_helper import assert_python_ok
215215from test .support import threading_helper , import_helper
216216from test .support .bytecode_helper import instructions_with_positions
@@ -1558,10 +1558,8 @@ def myfree(ptr):
15581558 # Make sure myfree sticks around at least as long as the interpreter,
15591559 # since we (currently) can't unregister the function and leaving a
15601560 # dangling pointer will cause a crash on deallocation of code objects if
1561- # something else uses co_extras, like test_capi.test_misc. (Maybe this
1562- # should use PyInterpreterState_GetDict, but that isn't easily exposed
1563- # to Python code.)
1564- setattr (sys , f'_test_code.{ myfree !r} ' , myfree )
1561+ # something else uses co_extras, like test_capi.test_misc.
1562+ late_deletion (myfree )
15651563
15661564 class CoExtra (unittest .TestCase ):
15671565 def get_func (self ):
You can’t perform that action at this time.
0 commit comments