From 9ec6aa4e4445bf18cdf2283e308c7956d90eb4d8 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 13 Nov 2023 00:30:44 +0100 Subject: [PATCH] Cleanup --- Modules/_functoolsmodule.c | 2 +- Modules/_threadmodule.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 9428f5f7b9360d..ac159cc8060c07 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -1088,7 +1088,7 @@ bounded_lru_cache_wrapper(lru_cache_object *self, PyObject *args, PyObject *kwds We created one other reference when the link was created. The linked list only has borrowed references. */ if (_PyDict_Pop_KnownHash((PyDictObject*)self->cache, link->key, - link->hash, Py_None, &popresult) < 0) { + link->hash, Py_None, &popresult) < 0) { /* An error arose while trying to remove the oldest key (the one being evicted) from the cache. We restore the link to its original position as the oldest link. Then we allow the diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 8c67df5126a354..9a842d6ed8c4a1 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -969,6 +969,7 @@ local_clear(localobject *self) if (tstate->dict) { PyObject *v; if (PyDict_Pop(tstate->dict, self->key, Py_None, &v) < 0) { + // Silently ignore error PyErr_Clear(); } else {