Commit aa2c7b9b authored by Stefan Behnel's avatar Stefan Behnel

fix copy&paste code in __Pyx_SetItemInt_ByteArray_Generic()

parent 0353b956
...@@ -303,15 +303,18 @@ static CYTHON_INLINE int __Pyx_SetItemInt_ByteArray_Fast(PyObject* string, Py_ss ...@@ -303,15 +303,18 @@ static CYTHON_INLINE int __Pyx_SetItemInt_ByteArray_Fast(PyObject* string, Py_ss
} }
static CYTHON_INLINE int __Pyx_SetItemInt_ByteArray_Generic(PyObject* string, PyObject* j, unsigned char v) { static CYTHON_INLINE int __Pyx_SetItemInt_ByteArray_Generic(PyObject* string, PyObject* j, unsigned char v) {
unsigned char bchar; int ret;
PyObject *bchar_string; PyObject *py_value;
if (!j) return -1; if (!j) return -1;
bchar_string = PyObject_GetItem(string, j); py_value = PyInt_FromLong(v);
if (!py_value) {
ret = -1;
} else {
ret = PyObject_SetItem(string, j, py_value);
Py_DECREF(py_value);
}
Py_DECREF(j); Py_DECREF(j);
if (!bchar_string) return -1; return ret;
bchar = (unsigned char) (PyByteArray_AS_STRING(bchar_string)[0]);
Py_DECREF(bchar_string);
return bchar;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment