From 1e07280cc7f50f828437309e595aee509ec0903e Mon Sep 17 00:00:00 2001 From: Yan Yanchii Date: Wed, 25 Dec 2024 18:42:04 +0100 Subject: [PATCH] [3.12] gh-128198: Add missing error checks for usages of PyIter_Next() (GH-128199) (cherry picked from commit 5c814c83cdd3dc42bd9682106ffb7ade7ce6b5b3) Co-authored-by: Yan Yanchii --- Objects/namespaceobject.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c index 2cc4ddd3c91daa..7082c6fd4657c6 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;