diff options
Diffstat (limited to 'Modules/_threadmodule.c')
-rw-r--r-- | Modules/_threadmodule.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index d075ef7..aacce69 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -777,9 +777,11 @@ local_clear(localobject *self) for(tstate = PyInterpreterState_ThreadHead(tstate->interp); tstate; tstate = PyThreadState_Next(tstate)) - if (tstate->dict && - PyDict_GetItem(tstate->dict, self->key)) - PyDict_DelItem(tstate->dict, self->key); + if (tstate->dict && PyDict_GetItem(tstate->dict, self->key)) { + if (PyDict_DelItem(tstate->dict, self->key)) { + PyErr_Clear(); + } + } } return 0; } |