Brad Bishop | 3579dc6 | 2015-11-17 22:43:42 -0500 | [diff] [blame] | 1 | Index: dbus-python-1.2.0/_dbus_bindings/bytes.c |
| 2 | =================================================================== |
| 3 | --- dbus-python-1.2.0.orig/_dbus_bindings/bytes.c |
| 4 | +++ dbus-python-1.2.0/_dbus_bindings/bytes.c |
| 5 | @@ -138,23 +138,6 @@ bad_range: |
| 6 | return NULL; |
| 7 | } |
| 8 | |
| 9 | -static PyObject * |
| 10 | -Byte_tp_str(PyObject *self) |
| 11 | -{ |
| 12 | - long i = NATIVEINT_ASLONG(self); |
| 13 | - unsigned char str[2] = { 0, 0 }; |
| 14 | - |
| 15 | - if (i == -1 && PyErr_Occurred()) |
| 16 | - return NULL; |
| 17 | - if (i < 0 || i > 255) { |
| 18 | - PyErr_SetString(PyExc_RuntimeError, "Integer outside range 0-255"); |
| 19 | - return NULL; |
| 20 | - } |
| 21 | - |
| 22 | - str[0] = (unsigned char)i; |
| 23 | - return PyUnicode_FromStringAndSize((char *)str, 1); |
| 24 | -} |
| 25 | - |
| 26 | PyTypeObject DBusPyByte_Type = { |
| 27 | PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) |
| 28 | "dbus.Byte", |
| 29 | @@ -171,7 +154,7 @@ PyTypeObject DBusPyByte_Type = { |
| 30 | 0, /* tp_as_mapping */ |
| 31 | 0, /* tp_hash */ |
| 32 | 0, /* tp_call */ |
| 33 | - Byte_tp_str, /* tp_str */ |
| 34 | + 0, /* tp_str */ |
| 35 | 0, /* tp_getattro */ |
| 36 | 0, /* tp_setattro */ |
| 37 | 0, /* tp_as_buffer */ |