]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-118849: Fix "code will never be executed" warning in `dictobject.c` (#118850)
authorNikita Sobolev <mail@sobolevn.me>
Thu, 9 May 2024 17:15:14 +0000 (20:15 +0300)
committerGitHub <noreply@github.com>
Thu, 9 May 2024 17:15:14 +0000 (20:15 +0300)
Objects/dictobject.c

index b0fce09d7940e0aebf86e320ef6c212f813dbc76..985a326a176c944c6251c858d90c78b73b28cab1 100644 (file)
@@ -5396,6 +5396,7 @@ static int
 dictiter_iternext_threadsafe(PyDictObject *d, PyObject *self,
                              PyObject **out_key, PyObject **out_value)
 {
+    int res;
     dictiterobject *di = (dictiterobject *)self;
     Py_ssize_t i;
     PyDictKeysObject *k;
@@ -5491,7 +5492,6 @@ fail:
     Py_DECREF(d);
     return -1;
 
-    int res;
 try_locked:
     Py_BEGIN_CRITICAL_SECTION(d);
     res = dictiter_iternextitem_lock_held(d, self, out_key, out_value);