summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2011-09-12 19:03:36 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2011-09-12 19:03:36 (GMT)
commitbbe46d63ee9b624c011b4fe50978e2e7fa7cf82e (patch)
treeb8ffdf974ee62f8164b0ed12ac67b0580faf5576 /Lib
parent1d7deafeea8fad9c58480f646e7ac125105288c5 (diff)
downloadcpython-bbe46d63ee9b624c011b4fe50978e2e7fa7cf82e.zip
cpython-bbe46d63ee9b624c011b4fe50978e2e7fa7cf82e.tar.gz
cpython-bbe46d63ee9b624c011b4fe50978e2e7fa7cf82e.tar.bz2
Issue #12483: ctypes: Fix a crash when the destruction of a callback
object triggers the garbage collector.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/ctypes/test/test_callbacks.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_callbacks.py b/Lib/ctypes/test/test_callbacks.py
index 8801ccd..c7207ea 100644
--- a/Lib/ctypes/test/test_callbacks.py
+++ b/Lib/ctypes/test/test_callbacks.py
@@ -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: