From 969ef7501c45eb4346d5c2992c9bdb69cc362438 Mon Sep 17 00:00:00 2001 From: Armin Rigo Date: Fri, 14 Apr 2006 14:58:30 +0000 Subject: [PATCH] Show case: reference cycles involving only the ob_type field are rather uncommon but possible. Inspired by SF bug 1469629. --- Lib/test/leakers/test_selftype.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Lib/test/leakers/test_selftype.py diff --git a/Lib/test/leakers/test_selftype.py b/Lib/test/leakers/test_selftype.py new file mode 100644 index 0000000000..4207c328ba --- /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() -- 2.40.0