Fix a whole bunch of error return NULL that should be return -1.

This commit is contained in:
Guido van Rossum 1998-05-29 02:59:33 +00:00
parent 9396673a58
commit ed6219b116
1 changed files with 5 additions and 5 deletions

View File

@ -887,7 +887,7 @@ PySequence_SetItem(s, i, o)
if (m->sq_length) { if (m->sq_length) {
int l = (*m->sq_length)(s); int l = (*m->sq_length)(s);
if (l < 0) if (l < 0)
return NULL; return -1;
i += l; i += l;
} }
} }
@ -916,7 +916,7 @@ PySequence_DelItem(s, i)
if (m->sq_length) { if (m->sq_length) {
int l = (*m->sq_length)(s); int l = (*m->sq_length)(s);
if (l < 0) if (l < 0)
return NULL; return -1;
i += l; i += l;
} }
} }
@ -947,7 +947,7 @@ PySequence_SetSlice(s, i1, i2, o)
if (m->sq_length) { if (m->sq_length) {
int l = (*m->sq_length)(s); int l = (*m->sq_length)(s);
if (l < 0) if (l < 0)
return NULL; return -1;
if (i1 < 0) if (i1 < 0)
i1 += l; i1 += l;
if (i2 < 0) if (i2 < 0)
@ -979,7 +979,7 @@ PySequence_DelSlice(s, i1, i2)
if (m->sq_length) { if (m->sq_length) {
int l = (*m->sq_length)(s); int l = (*m->sq_length)(s);
if (l < 0) if (l < 0)
return NULL; return -1;
if (i1 < 0) if (i1 < 0)
i1 += l; i1 += l;
if (i2 < 0) if (i2 < 0)
@ -1280,7 +1280,7 @@ PyMapping_SetItemString(o, key, value)
okey = PyString_FromString(key); okey = PyString_FromString(key);
if (okey == NULL) if (okey == NULL)
return NULL; return -1;
r = PyObject_SetItem(o, okey, value); r = PyObject_SetItem(o, okey, value);
Py_DECREF(okey); Py_DECREF(okey);
return r; return r;