Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed6219b

Browse files
committed
Fix a whole bunch of error return NULL that should be return -1.
1 parent 9396673 commit ed6219b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Objects/abstract.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ PySequence_SetItem(s, i, o)
887887
if (m->sq_length) {
888888
int l = (*m->sq_length)(s);
889889
if (l < 0)
890-
return NULL;
890+
return -1;
891891
i += l;
892892
}
893893
}
@@ -916,7 +916,7 @@ PySequence_DelItem(s, i)
916916
if (m->sq_length) {
917917
int l = (*m->sq_length)(s);
918918
if (l < 0)
919-
return NULL;
919+
return -1;
920920
i += l;
921921
}
922922
}
@@ -947,7 +947,7 @@ PySequence_SetSlice(s, i1, i2, o)
947947
if (m->sq_length) {
948948
int l = (*m->sq_length)(s);
949949
if (l < 0)
950-
return NULL;
950+
return -1;
951951
if (i1 < 0)
952952
i1 += l;
953953
if (i2 < 0)
@@ -979,7 +979,7 @@ PySequence_DelSlice(s, i1, i2)
979979
if (m->sq_length) {
980980
int l = (*m->sq_length)(s);
981981
if (l < 0)
982-
return NULL;
982+
return -1;
983983
if (i1 < 0)
984984
i1 += l;
985985
if (i2 < 0)
@@ -1280,7 +1280,7 @@ PyMapping_SetItemString(o, key, value)
12801280

12811281
okey = PyString_FromString(key);
12821282
if (okey == NULL)
1283-
return NULL;
1283+
return -1;
12841284
r = PyObject_SetItem(o, okey, value);
12851285
Py_DECREF(okey);
12861286
return r;

0 commit comments

Comments
 (0)