MCPcopy Index your code
hub / github.com/python/cpython / make_finalizers

Method make_finalizers

Lib/test/_test_multiprocessing.py:5150–5160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5148 exc = e
5149
5150 def make_finalizers():
5151 nonlocal exc
5152 d = {}
5153 while not finish:
5154 try:
5155 # Old Foo's get gradually replaced and later
5156 # collected by the GC (because of the cyclic ref)
5157 d[random.getrandbits(5)] = {Foo() for i in range(10)}
5158 except Exception as e:
5159 exc = e
5160 d.clear()
5161
5162 old_interval = sys.getswitchinterval()
5163 old_threshold = gc.get_threshold()

Callers

nothing calls this directly

Calls 3

FooClass · 0.70
getrandbitsMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected