Backport part of r65043.
This commit is contained in:
parent
3e75846cf6
commit
3238a3e329
|
@ -55,10 +55,9 @@ _getbytevalue(PyObject* arg, int *value)
|
|||
face_value = PyLong_AsLong(index);
|
||||
Py_DECREF(index);
|
||||
}
|
||||
if (face_value == -1 && PyErr_Occurred())
|
||||
return 0;
|
||||
|
||||
if (face_value < 0 || face_value >= 256) {
|
||||
/* this includes the OverflowError in case the long is too large */
|
||||
PyErr_SetString(PyExc_ValueError, "byte must be in range(0, 256)");
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue