summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/tdb/pytdb.c3
-rw-r--r--libcli/nbt/pynbt.c2
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/Python.pm4
-rw-r--r--python/py3compat.h1
-rw-r--r--source4/lib/wmi/wmi.i2
-rw-r--r--source4/lib/wmi/wmi_wrap.c8
-rw-r--r--source4/librpc/rpc/pyrpc.c2
7 files changed, 10 insertions, 12 deletions
diff --git a/lib/tdb/pytdb.c b/lib/tdb/pytdb.c
index 74e80f95ec5..7211d466a71 100644
--- a/lib/tdb/pytdb.c
+++ b/lib/tdb/pytdb.c
@@ -33,7 +33,6 @@
#if PY_MAJOR_VERSION >= 3
#define PyInt_FromLong PyLong_FromLong
-#define PyInt_Check PyLong_Check
#define PyInt_AsLong PyLong_AsLong
#define Py_TPFLAGS_HAVE_ITER 0
#endif
@@ -555,7 +554,7 @@ static PyObject *obj_get_hash_size(PyTdbObject *self, void *closure)
static int obj_set_max_dead(PyTdbObject *self, PyObject *max_dead, void *closure)
{
PyErr_TDB_RAISE_RETURN_MINUS_1_IF_CLOSED(self);
- if (!PyInt_Check(max_dead))
+ if (!PyLong_Check(max_dead))
return -1;
tdb_set_max_dead(self->ctx, PyInt_AsLong(max_dead));
return 0;
diff --git a/libcli/nbt/pynbt.c b/libcli/nbt/pynbt.c
index a562f6dcb5e..1148da7289d 100644
--- a/libcli/nbt/pynbt.c
+++ b/libcli/nbt/pynbt.c
@@ -79,7 +79,7 @@ static bool PyObject_AsDestinationTuple(PyObject *obj, const char **dest_addr, u
if (PyTuple_Size(obj) == 1) {
*dest_port = NBT_NAME_SERVICE_PORT;
return true;
- } else if (PyInt_Check(PyTuple_GetItem(obj, 1))) {
+ } else if (PyLong_Check(PyTuple_GetItem(obj, 1))) {
*dest_port = PyInt_AsLong(PyTuple_GetItem(obj, 1));
return true;
} else {
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 84d4dade512..b2a65cc7376 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -1754,7 +1754,7 @@ sub ConvertObjectFromPythonData($$$$$$;$$)
$self->pidl("}");
$self->pidl("$target = test_var;");
$self->deindent;
- $self->pidl("} else if (PyInt_Check($cvar)) {");
+ $self->pidl("} else if (PyLong_Check($cvar)) {");
$self->indent;
$self->pidl("long test_var;");
$self->pidl("test_var = PyInt_AsLong($cvar);");
@@ -1806,7 +1806,7 @@ sub ConvertObjectFromPythonData($$$$$$;$$)
$self->pidl("}");
$self->pidl("$target = test_var;");
$self->deindent;
- $self->pidl("} else if (PyInt_Check($cvar)) {");
+ $self->pidl("} else if (PyLong_Check($cvar)) {");
$self->indent;
$self->pidl("long test_var;");
$self->pidl("test_var = PyInt_AsLong($cvar);");
diff --git a/python/py3compat.h b/python/py3compat.h
index d2adb24c6a2..30982a80293 100644
--- a/python/py3compat.h
+++ b/python/py3compat.h
@@ -73,7 +73,6 @@
/* Ints */
#define PyInt_Type PyLong_Type
-#define PyInt_Check PyLong_Check
#define PyInt_FromLong PyLong_FromLong
#define PyInt_AsLong PyLong_AsLong
diff --git a/source4/lib/wmi/wmi.i b/source4/lib/wmi/wmi.i
index 2c8bbe517eb..b23ed6152cf 100644
--- a/source4/lib/wmi/wmi.i
+++ b/source4/lib/wmi/wmi.i
@@ -302,7 +302,7 @@ typedef struct IEnumWbemClassObject {
%typemap(in, numinputs=1) (uint32_t uCount, struct WbemClassObject **apObjects, uint32_t *puReturned) (uint32_t uReturned) {
if (PyLong_Check($input))
$1 = PyLong_AsUnsignedLong($input);
- else if (PyInt_Check($input))
+ else if (PyLong_Check($input))
$1 = PyInt_AsLong($input);
else {
PyErr_SetString(PyExc_TypeError,"Expected a long or an int");
diff --git a/source4/lib/wmi/wmi_wrap.c b/source4/lib/wmi/wmi_wrap.c
index 0fd94300ba3..c44eeefccee 100644
--- a/source4/lib/wmi/wmi_wrap.c
+++ b/source4/lib/wmi/wmi_wrap.c
@@ -2670,7 +2670,7 @@ SWIG_AsVal_double (PyObject *obj, double *val)
if (PyFloat_Check(obj)) {
if (val) *val = PyFloat_AsDouble(obj);
return SWIG_OK;
- } else if (PyInt_Check(obj)) {
+ } else if (PyLong_Check(obj)) {
if (val) *val = PyInt_AsLong(obj);
return SWIG_OK;
} else if (PyLong_Check(obj)) {
@@ -2746,7 +2746,7 @@ SWIG_CanCastAsInteger(double *d, double min, double max) {
SWIGINTERN int
SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
{
- if (PyInt_Check(obj)) {
+ if (PyLong_Check(obj)) {
long v = PyInt_AsLong(obj);
if (v >= 0) {
if (val) *val = v;
@@ -2824,7 +2824,7 @@ SWIG_From_unsigned_SS_int (unsigned int value)
SWIGINTERN int
SWIG_AsVal_long (PyObject *obj, long* val)
{
- if (PyInt_Check(obj)) {
+ if (PyLong_Check(obj)) {
if (val) *val = PyInt_AsLong(obj);
return SWIG_OK;
} else if (PyLong_Check(obj)) {
@@ -3607,7 +3607,7 @@ SWIGINTERN PyObject *_wrap_IEnumWbemClassObject_SmartNext(PyObject *SWIGUNUSEDPA
{
if (PyLong_Check(obj2))
arg4 = PyLong_AsUnsignedLong(obj2);
- else if (PyInt_Check(obj2))
+ else if (PyLong_Check(obj2))
arg4 = PyInt_AsLong(obj2);
else {
PyErr_SetString(PyExc_TypeError,"Expected a long or an int");
diff --git a/source4/librpc/rpc/pyrpc.c b/source4/librpc/rpc/pyrpc.c
index 3f2f7154fa7..33841ae0f11 100644
--- a/source4/librpc/rpc/pyrpc.c
+++ b/source4/librpc/rpc/pyrpc.c
@@ -73,7 +73,7 @@ static bool ndr_syntax_from_py_object(PyObject *object, struct ndr_syntax_id *sy
}
item = PyTuple_GetItem(object, 1);
- if (!PyInt_Check(item)) {
+ if (!PyLong_Check(item)) {
PyErr_SetString(PyExc_ValueError, "Expected version as second element in tuple");
return false;
}