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