File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -412,13 +412,6 @@ class RefTrace(Trace):
412412 :attr:`Trace.ref`. This feature requires a context manager, to guarantee
413413 modifications are written back to disk.
414414 """
415-
416- # If there are no external references to the data (so only internal
417- # references remain), the reference count is
418- # - 2 (Python >= 3.14)
419- # - 3 (Python < 3.14)
420- _GARBAGE_THRESHOLD = 3 if sys .version_info < (3 , 14 ) else 2
421-
422415 def __init__ (self , * args ):
423416 super (RefTrace , self ).__init__ (* args )
424417 self .refs = {}
@@ -442,6 +435,11 @@ def flush(self):
442435 be useful in certain contexts to provide stronger guarantees.
443436 """
444437 garbage = []
438+ # If there are no external references to the data (so only internal
439+ # references remain), the reference count is
440+ # - 2 (Python >= 3.14)
441+ # - 3 (Python < 3.14)
442+ garbage_threshold = 3 if sys .version_info < (3 , 14 ) else 2
445443
446444 for i , (x , signature ) in self .refs .items ():
447445 if sys .getrefcount (x ) == self ._GARBAGE_THRESHOLD :
You can’t perform that action at this time.
0 commit comments