]> granicus.if.org Git - python/commitdiff
Backport part of r65043.
authorGeorg Brandl <georg@python.org>
Wed, 16 Jul 2008 23:17:46 +0000 (23:17 +0000)
committerGeorg Brandl <georg@python.org>
Wed, 16 Jul 2008 23:17:46 +0000 (23:17 +0000)
Objects/bytearrayobject.c

index 31b58048711c0b87b00edf1baa9f6bedbf2908e9..e31b7d5fdf3db29191acdf2ae35b025fae192a4a 100644 (file)
@@ -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;
     }