mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Issue #12483: ctypes: Fix a crash when the destruction of a callback
object triggers the garbage collector.
This commit is contained in:
parent
1d7deafeea
commit
bbe46d63ee
3 changed files with 12 additions and 0 deletions
|
|
@ -134,6 +134,14 @@ class Callbacks(unittest.TestCase):
|
|||
if isinstance(x, X)]
|
||||
self.assertEqual(len(live), 0)
|
||||
|
||||
def test_issue12483(self):
|
||||
import gc
|
||||
class Nasty:
|
||||
def __del__(self):
|
||||
gc.collect()
|
||||
CFUNCTYPE(None)(lambda x=Nasty(): None)
|
||||
|
||||
|
||||
try:
|
||||
WINFUNCTYPE
|
||||
except NameError:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue