Skip to content

Commit fe709f8

Browse files
committed
Fix error checking
1 parent 17feaa6 commit fe709f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_sre/sre.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2492,7 +2492,7 @@ match_getitem(PyObject *op, PyObject* item)
24922492
PyObject* index = PyDict_GetItemWithError(self->pattern->groupindex, item);
24932493
if (index && PyLong_Check(index)) {
24942494
Py_ssize_t i = PyLong_AsSsize_t(index);
2495-
if (i != -1) {
2495+
if (!PyErr_Occurred()) {
24962496
return match_item(op, i);
24972497
}
24982498
}

0 commit comments

Comments
 (0)