Skip to content

Commit 1c58e95

Browse files
committed
Add PyIter_Next error check in namespaceobject.c`
1 parent 992aff1 commit 1c58e95

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Objects/namespaceobject.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ namespace_repr(PyObject *ns)
141141
goto error;
142142
}
143143

144+
/* Check if loop ended because of exception in PyIter_Next */
145+
if (PyErr_Occurred()) {
146+
goto error;
147+
}
148+
144149
separator = PyUnicode_FromString(", ");
145150
if (separator == NULL)
146151
goto error;

0 commit comments

Comments
 (0)