blob: 12f29345d2c25e3beab39f0cc715b16d5b65ddad [file] [log] [blame]
Thomas Wouters49fd7fa2006-04-21 10:40:58 +00001# Reference cycles involving only the ob_type field are rather uncommon
2# but possible. Inspired by SF bug 1469629.
3
4import gc
5
6def leak():
7 class T(type):
8 pass
Guido van Rossum52cc1d82007-03-18 15:41:51 +00009 class U(type, metaclass=T):
10 pass
Thomas Wouters49fd7fa2006-04-21 10:40:58 +000011 U.__class__ = U
12 del U
13 gc.collect(); gc.collect(); gc.collect()