[Python-checkins] r65044 - python/trunk/Objects/bytearrayobject.c
georg.brandl
python-checkins at python.org
Thu Jul 17 01:17:46 CEST 2008
Author: georg.brandl
Date: Thu Jul 17 01:17:46 2008
New Revision: 65044
Log:
Backport part of r65043.
Modified:
python/trunk/Objects/bytearrayobject.c
Modified: python/trunk/Objects/bytearrayobject.c
==============================================================================
--- python/trunk/Objects/bytearrayobject.c (original)
+++ python/trunk/Objects/bytearrayobject.c Thu Jul 17 01:17:46 2008
@@ -55,10 +55,9 @@
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;
}
More information about the Python-checkins
mailing list