diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-01-11 15:01:39 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-01-11 15:03:08 +0000 |
commit | 4f043cf34a8001c071644eb8c89dc7d43e86b62a (patch) | |
tree | ed5d9528135327764a84fa9d4bccb21a30e2adea /_dbus_bindings/abstract.c | |
parent | cdc0ca5c72686aab38a172f14da3b38fe304baa9 (diff) | |
download | dbus-python-4f043cf34a8001c071644eb8c89dc7d43e86b62a.tar.gz |
Use native 'int' (whatever that means) for variant_level etc.
This reverts the Python 2 API to be in terms of PyInt, leaving the
Python 3 API in terms of PyLong (which is called 'int' in Python code).
Diffstat (limited to '_dbus_bindings/abstract.c')
-rw-r--r-- | _dbus_bindings/abstract.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/_dbus_bindings/abstract.c b/_dbus_bindings/abstract.c index 1e2fa25..2b31d43 100644 --- a/_dbus_bindings/abstract.c +++ b/_dbus_bindings/abstract.c @@ -61,7 +61,7 @@ dbus_py_variant_level_get(PyObject *obj) */ return 0; } - variant_level = PyLong_AsLong(vl_obj); + variant_level = NATIVEINT_ASLONG(vl_obj); if (variant_level == -1 && PyErr_Occurred()) { /* variant_level < 0 can never be inserted into the dictionary; see * dbus_py_variant_level_set() below. The semantics of setting @@ -92,7 +92,7 @@ dbus_py_variant_level_set(PyObject *obj, long variant_level) } } else { - PyObject *vl_obj = PyLong_FromLong(variant_level); + PyObject *vl_obj = NATIVEINT_FROMLONG(variant_level); if (!vl_obj) { Py_CLEAR(key); return FALSE; @@ -148,7 +148,7 @@ dbus_py_variant_level_getattro(PyObject *obj, PyObject *name) Py_CLEAR(key); if (!value) - return PyLong_FromLong(0); + return NATIVEINT_FROMLONG(0); Py_INCREF(value); return value; } @@ -444,7 +444,7 @@ DBusPythonBytes_tp_repr(PyObject *self) Py_CLEAR(parent_repr); return NULL; } - variant_level = PyLong_AsLong(vl_obj); + variant_level = NATIVEINT_ASLONG(vl_obj); Py_CLEAR(vl_obj); if (variant_level == -1 && PyErr_Occurred()) { Py_CLEAR(parent_repr); @@ -566,7 +566,7 @@ DBusPythonString_tp_repr(PyObject *self) Py_CLEAR(parent_repr); return NULL; } - variant_level = PyLong_AsLong(vl_obj); + variant_level = NATIVEINT_ASLONG(vl_obj); Py_CLEAR(vl_obj); if (variant_level == -1 && PyErr_Occurred()) { Py_CLEAR(parent_repr); @@ -688,7 +688,7 @@ DBusPythonLong_tp_repr(PyObject *self) Py_CLEAR(parent_repr); return NULL; } - variant_level = PyLong_AsLong(vl_obj); + variant_level = NATIVEINT_ASLONG(vl_obj); Py_CLEAR(vl_obj); if (variant_level < 0 && PyErr_Occurred()) { Py_CLEAR(parent_repr); |