We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b83257 commit e91fd42Copy full SHA for e91fd42
Lib/concurrent/interpreters/__init__.py
@@ -149,12 +149,14 @@ def __del__(self):
149
def __reduce__(self):
150
return (type(self), (self._id,))
151
152
- def _decref(self):
+ # gh-135729: Globals might be destroyed by the time this is called, so we
153
+ # need to keep references ourself
154
+ def _decref(self, InterpreterNotFoundError=InterpreterNotFoundError, _interp_decref=_interpreters.decref):
155
if not self._ownsref:
156
return
157
self._ownsref = False
158
try:
- _interpreters.decref(self._id)
159
+ _interp_decref(self._id)
160
except InterpreterNotFoundError:
161
pass
162
0 commit comments