From f699151c8769a63382f9f484581c4d3debda628b Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 26 Dec 2024 12:38:48 +0200 Subject: [PATCH] [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 --- Objects/namespaceobject.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.47.3