summaryrefslogtreecommitdiff
path: root/_dbus_bindings/bytes.c
diff options
context:
space:
mode:
Diffstat (limited to '_dbus_bindings/bytes.c')
-rw-r--r--_dbus_bindings/bytes.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/_dbus_bindings/bytes.c b/_dbus_bindings/bytes.c
index 9914319..fc490d9 100644
--- a/_dbus_bindings/bytes.c
+++ b/_dbus_bindings/bytes.c
@@ -96,12 +96,8 @@ Byte_new(PyTypeObject *cls, PyObject *args, PyObject *kwargs)
if (!obj)
goto bad_arg;
}
- else if (PyLong_Check(obj)
-#ifndef PY3
- || PyInt_Check(obj)
-#endif
- )
- {
+ else if (INTORLONG_CHECK(obj)) {
+ /* on Python 2 this accepts either int or long */
long i = PyLong_AsLong(obj);
long my_variant_level;