Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/test/leakers/test_dictself.py

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


'''Test case for "self.__dict__ = self" circular reference bug (#1469629)'''

import gc

class LeakyDict(dict):
    pass

def leak():
    ld = LeakyDict()
    ld.__dict__ = ld
    del ld
    gc.collect(); gc.collect(); gc.collect()

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.