diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 180b6b20089..82f92195742 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -282,7 +282,7 @@ sub PythonStruct($$$$$$) $self->indent; $self->pidl("$cname *object = ($cname *)pytalloc_get_ptr(py_obj);"); $self->pidl("DATA_BLOB blob;"); - $self->pidl("int blob_length = 0;"); + $self->pidl("Py_ssize_t blob_length = 0;"); $self->pidl("enum ndr_err_code err;"); $self->pidl("const char * const kwnames[] = { \"data_blob\", \"allow_remaining\", NULL };"); $self->pidl("PyObject *allow_remaining_obj = NULL;"); @@ -1490,6 +1490,7 @@ sub Parse($$$$$) $self->pidl_hdr(" /* Python wrapper functions auto-generated by pidl */ +#define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */ #include #include \"includes.h\" #include