summaryrefslogtreecommitdiffstats
path: root/Lib/test/crashers/weakref_in_del.py
blob: 5c8ca158d0b74b6e49ddd8ed5c65cbca0e96e50d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import weakref

# http://python.org/sf/1377858


ref = None

def test_weakref_in_del():
    class Target(object):
        def __del__(self):
            global ref
            ref = weakref.ref(self)

    w = Target()

if __name__ == '__main__':
    test_weakref_in_del()