From: Serhiy Storchaka Date: Thu, 26 Dec 2024 10:38:48 +0000 (+0200) Subject: [3.12] gh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199... X-Git-Tag: v3.12.9~134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f699151c8769a63382f9f484581c4d3debda628b;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199) (GH-128273) (cherry picked from commit 5c814c83cdd3dc42bd9682106ffb7ade7ce6b5b3) Co-authored-by: Yan Yanchii --- diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c index 2cc4ddd3c91d..7082c6fd4657 100644 --- a/Objects/namespaceobject.c +++ b/Objects/namespaceobject.c @@ -121,6 +121,10 @@ namespace_repr(PyObject *ns) goto error; } + if (PyErr_Occurred()) { + goto error; + } + separator = PyUnicode_FromString(", "); if (separator == NULL) goto error;