summaryrefslogtreecommitdiffstats
path: root/AppPkg/Applications/Python/Python-2.7.2/Lib/test/leakers/test_selftype.py
blob: 2d63ec6797c6aedfc2b1154ad4cd9df4741c8b54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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()