summaryrefslogtreecommitdiff
path: root/Lib/weakref.py
diff options
context:
space:
mode:
author?ukasz Langa <lukasz@langa.pl>2017-02-10 00:14:55 -0800
committer?ukasz Langa <lukasz@langa.pl>2017-02-10 00:14:55 -0800
commit4b1bb99319543d67de2c6754a1dcc13d334aaa2d (patch)
tree3d7bce49f9526a58e8f7177f4a2a69d7b9744467 /Lib/weakref.py
parent5e0114a832a903518c4af6983161c0c2a8942a24 (diff)
downloadcpython-3.5.tar.gz
Fix #29519: weakref spewing exceptions during interp finalization3.5
Diffstat (limited to 'Lib/weakref.py')
-rw-r--r--Lib/weakref.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/weakref.py b/Lib/weakref.py
index aaebd0c464..787e33a327 100644
--- a/Lib/weakref.py
+++ b/Lib/weakref.py
@@ -106,7 +106,7 @@ class WeakValueDictionary(collections.MutableMapping):
self, *args = args
if len(args) > 1:
raise TypeError('expected at most 1 arguments, got %d' % len(args))
- def remove(wr, selfref=ref(self)):
+ def remove(wr, selfref=ref(self), _atomic_removal=_remove_dead_weakref):
self = selfref()
if self is not None:
if self._iterating:
@@ -114,7 +114,7 @@ class WeakValueDictionary(collections.MutableMapping):
else:
# Atomic removal is necessary since this function
# can be called asynchronously by the GC
- _remove_dead_weakref(d, wr.key)
+ _atomic_removal(d, wr.key)
self._remove = remove
# A list of keys to be removed
self._pending_removals = []