def report_uncollectable():
import gc
if not gc.garbage:
print("No garbages!")
return
print('uncollectable objects')
for obj in gc.garbage:
print(obj)
if hasattr(obj, '__dict__'):
print(obj.__dict__)
for ref in gc.get_referrers(obj):
print("referrer:", ref)
print('---')
评论列表
文章目录