summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2019-07-15 14:11:03 +0100
committerSimon McVittie <smcv@collabora.com>2019-07-15 15:51:05 +0100
commitab408a3061c7aeaf9320968bd17b3ec812c1f810 (patch)
tree026f2545b2ac6be548be3fddbab3b85446607577
parent97460ead80ec547fb837a2cb16592703f8645538 (diff)
Don't set deprecated tp_print to NULL on Python 3
This has apparently never actually done anything in the Python 3 series. Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--dbus_bindings/abstract.c7
-rw-r--r--dbus_bindings/bytes.c4
-rw-r--r--dbus_bindings/containers.c6
-rw-r--r--dbus_bindings/float.c4
-rw-r--r--dbus_bindings/int.c14
-rw-r--r--dbus_bindings/signature.c2
-rw-r--r--dbus_bindings/string.c4
7 files changed, 40 insertions, 1 deletions
diff --git a/dbus_bindings/abstract.c b/dbus_bindings/abstract.c
index 6b549e6..2e3b914 100644
--- a/dbus_bindings/abstract.c
+++ b/dbus_bindings/abstract.c
@@ -792,7 +792,6 @@ dbus_py_init_abstract(void)
#ifdef PY3
DBusPyBytesBase_Type.tp_base = &PyBytes_Type;
if (PyType_Ready(&DBusPyBytesBase_Type) < 0) return 0;
- DBusPyBytesBase_Type.tp_print = NULL;
#else
DBusPyIntBase_Type.tp_base = &PyInt_Type;
if (PyType_Ready(&DBusPyIntBase_Type) < 0) return 0;
@@ -803,15 +802,21 @@ dbus_py_init_abstract(void)
DBusPyFloatBase_Type.tp_base = &PyFloat_Type;
if (PyType_Ready(&DBusPyFloatBase_Type) < 0) return 0;
+#ifndef PY3
DBusPyFloatBase_Type.tp_print = NULL;
+#endif
DBusPyLongBase_Type.tp_base = &PyLong_Type;
if (PyType_Ready(&DBusPyLongBase_Type) < 0) return 0;
+#ifndef PY3
DBusPyLongBase_Type.tp_print = NULL;
+#endif
DBusPyStrBase_Type.tp_base = &NATIVESTR_TYPE;
if (PyType_Ready(&DBusPyStrBase_Type) < 0) return 0;
+#ifndef PY3
DBusPyStrBase_Type.tp_print = NULL;
+#endif
return 1;
}
diff --git a/dbus_bindings/bytes.c b/dbus_bindings/bytes.c
index e15ce4c..611d239 100644
--- a/dbus_bindings/bytes.c
+++ b/dbus_bindings/bytes.c
@@ -280,11 +280,15 @@ dbus_py_init_byte_types(void)
{
DBusPyByte_Type.tp_base = &DBUS_PY_BYTE_BASE;
if (PyType_Ready(&DBusPyByte_Type) < 0) return 0;
+#ifndef PY3
DBusPyByte_Type.tp_print = NULL;
+#endif
DBusPyByteArray_Type.tp_base = &DBUS_PY_BYTEARRAY_BASE;
if (PyType_Ready(&DBusPyByteArray_Type) < 0) return 0;
+#ifndef PY3
DBusPyByteArray_Type.tp_print = NULL;
+#endif
return 1;
}
diff --git a/dbus_bindings/containers.c b/dbus_bindings/containers.c
index 019c60d..7994d1f 100644
--- a/dbus_bindings/containers.c
+++ b/dbus_bindings/containers.c
@@ -777,15 +777,21 @@ dbus_py_init_container_types(void)
DBusPyArray_Type.tp_base = &PyList_Type;
if (PyType_Ready(&DBusPyArray_Type) < 0) return 0;
+#ifndef PY3
DBusPyArray_Type.tp_print = NULL;
+#endif
DBusPyDict_Type.tp_base = &PyDict_Type;
if (PyType_Ready(&DBusPyDict_Type) < 0) return 0;
+#ifndef PY3
DBusPyDict_Type.tp_print = NULL;
+#endif
DBusPyStruct_Type.tp_base = &PyTuple_Type;
if (PyType_Ready(&DBusPyStruct_Type) < 0) return 0;
+#ifndef PY3
DBusPyStruct_Type.tp_print = NULL;
+#endif
return 1;
}
diff --git a/dbus_bindings/float.c b/dbus_bindings/float.c
index 7a682e4..eeabd5b 100644
--- a/dbus_bindings/float.c
+++ b/dbus_bindings/float.c
@@ -130,13 +130,17 @@ dbus_py_init_float_types(void)
{
DBusPyDouble_Type.tp_base = &DBusPyFloatBase_Type;
if (PyType_Ready(&DBusPyDouble_Type) < 0) return 0;
+#ifndef PY3
DBusPyDouble_Type.tp_print = NULL;
+#endif
#ifdef WITH_DBUS_FLOAT32
DBusPyFloat_Type.tp_base = &DBusPyFloatBase_Type;
if (PyType_Ready(&DBusPyFloat_Type) < 0) return 0;
+#ifndef PY3
DBusPyFloat_Type.tp_print = NULL;
#endif
+#endif
return 1;
}
diff --git a/dbus_bindings/int.c b/dbus_bindings/int.c
index f26c55a..696f93e 100644
--- a/dbus_bindings/int.c
+++ b/dbus_bindings/int.c
@@ -721,35 +721,49 @@ dbus_py_init_int_types(void)
{
DBusPyInt16_Type.tp_base = &INTBASE;
if (PyType_Ready(&DBusPyInt16_Type) < 0) return 0;
+#ifndef PY3
/* disable the tp_print copied from PyInt_Type, so tp_repr gets called as
desired */
DBusPyInt16_Type.tp_print = NULL;
+#endif
DBusPyUInt16_Type.tp_base = &INTBASE;
if (PyType_Ready(&DBusPyUInt16_Type) < 0) return 0;
+#ifndef PY3
DBusPyUInt16_Type.tp_print = NULL;
+#endif
DBusPyInt32_Type.tp_base = &INTBASE;
if (PyType_Ready(&DBusPyInt32_Type) < 0) return 0;
+#ifndef PY3
DBusPyInt32_Type.tp_print = NULL;
+#endif
DBusPyUInt32_Type.tp_base = &DBusPyLongBase_Type;
if (PyType_Ready(&DBusPyUInt32_Type) < 0) return 0;
+#ifndef PY3
DBusPyUInt32_Type.tp_print = NULL;
+#endif
#if defined(DBUS_HAVE_INT64) && defined(HAVE_LONG_LONG)
DBusPyInt64_Type.tp_base = &DBusPyLongBase_Type;
if (PyType_Ready(&DBusPyInt64_Type) < 0) return 0;
+#ifndef PY3
DBusPyInt64_Type.tp_print = NULL;
+#endif
DBusPyUInt64_Type.tp_base = &DBusPyLongBase_Type;
if (PyType_Ready(&DBusPyUInt64_Type) < 0) return 0;
+#ifndef PY3
DBusPyUInt64_Type.tp_print = NULL;
#endif
+#endif
DBusPyBoolean_Type.tp_base = &INTBASE;
if (PyType_Ready(&DBusPyBoolean_Type) < 0) return 0;
+#ifndef PY3
DBusPyBoolean_Type.tp_print = NULL;
+#endif
return 1;
}
diff --git a/dbus_bindings/signature.c b/dbus_bindings/signature.c
index 900740e..403907d 100644
--- a/dbus_bindings/signature.c
+++ b/dbus_bindings/signature.c
@@ -235,7 +235,9 @@ dbus_py_init_signature(void)
DBusPySignature_Type.tp_base = &DBusPyStrBase_Type;
if (PyType_Ready(&DBusPySignature_Type) < 0) return 0;
+#ifndef PY3
DBusPySignature_Type.tp_print = NULL;
+#endif
return 1;
}
diff --git a/dbus_bindings/string.c b/dbus_bindings/string.c
index a7510d5..b6f42ac 100644
--- a/dbus_bindings/string.c
+++ b/dbus_bindings/string.c
@@ -339,7 +339,9 @@ dbus_py_init_string_types(void)
}
DBusPyString_Type.tp_base = &PyUnicode_Type;
if (PyType_Ready(&DBusPyString_Type) < 0) return 0;
+#ifndef PY3
DBusPyString_Type.tp_print = NULL;
+#endif
#ifndef PY3
DBusPyUTF8String_Type.tp_base = &DBusPyStrBase_Type;
@@ -349,7 +351,9 @@ dbus_py_init_string_types(void)
DBusPyObjectPath_Type.tp_base = &DBusPyStrBase_Type;
if (PyType_Ready(&DBusPyObjectPath_Type) < 0) return 0;
+#ifndef PY3
DBusPyObjectPath_Type.tp_print = NULL;
+#endif
return 1;
}