summaryrefslogtreecommitdiffstats
path: root/Lib/test/leakers
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/leakers')
-rw-r--r--Lib/test/leakers/test_selftype.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/leakers/test_selftype.py b/Lib/test/leakers/test_selftype.py
new file mode 100644
index 0000000..4207c32
--- /dev/null
+++ b/Lib/test/leakers/test_selftype.py
@@ -0,0 +1,13 @@
+# Reference cycles involving only the ob_type field are rather uncommon
+# but possible. Inspired by SF bug 1469629.
+
+import gc
+
+def leak():
+ class T(type):
+ pass
+ class U(type):
+ __metaclass__ = T
+ U.__class__ = U
+ del U
+ gc.collect(); gc.collect(); gc.collect()