Skip to content

Commit f551a05

Browse files
Update str_ops.c
1 parent 6d1dc5e commit f551a05

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mypyc/lib-rt/str_ops.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ Py_ssize_t CPyStr_Count(PyObject *unicode, PyObject *substring, CPyTagged start)
515515
Py_ssize_t temp_start = CPyTagged_AsSsize_t(start);
516516
if (temp_start == -1 && PyErr_Occurred()) {
517517
PyErr_SetString(PyExc_OverflowError, CPYTHON_LARGE_INT_ERRMSG);
518-
return NULL;
518+
return -1;
519519
}
520520
Py_ssize_t end = PyUnicode_GET_LENGTH(unicode);
521521
return PyUnicode_Count(unicode, substring, temp_start, end);
@@ -525,12 +525,12 @@ Py_ssize_t CPyStr_CountFull(PyObject *unicode, PyObject *substring, CPyTagged st
525525
Py_ssize_t temp_start = CPyTagged_AsSsize_t(start);
526526
if (temp_start == -1 && PyErr_Occurred()) {
527527
PyErr_SetString(PyExc_OverflowError, CPYTHON_LARGE_INT_ERRMSG);
528-
return NULL;
528+
return -1;
529529
}
530530
Py_ssize_t temp_end = CPyTagged_AsSsize_t(end);
531531
if (temp_end == -1 && PyErr_Occurred()) {
532532
PyErr_SetString(PyExc_OverflowError, CPYTHON_LARGE_INT_ERRMSG);
533-
return NULL;
533+
return -1;
534534
}
535535
return PyUnicode_Count(unicode, substring, temp_start, temp_end);
536536
}

0 commit comments

Comments
 (0)