From: Andrew Bartlett Date: Sat, 14 Mar 2020 21:10:24 +0000 (+1300) Subject: pidl: Remove duplicate "if (PyLong_Check($cvar)" clauses X-Git-Tag: ldb-2.2.0~1281 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79044e966cbe44d60997ecbd4b44f07305d99ac2;p=thirdparty%2Fsamba.git pidl: Remove duplicate "if (PyLong_Check($cvar)" clauses Since we moved to Python3, these have been dead code, and it is clearer now that we have removed the compatability define. Signed-off-by: Andrew Bartlett Reviewed-by: Noel Power --- diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index b2a65cc7376..6cd85d1a36c 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -1754,19 +1754,6 @@ sub ConvertObjectFromPythonData($$$$$$;$$) $self->pidl("}"); $self->pidl("$target = test_var;"); $self->deindent; - $self->pidl("} else if (PyLong_Check($cvar)) {"); - $self->indent; - $self->pidl("long test_var;"); - $self->pidl("test_var = PyInt_AsLong($cvar);"); - $self->pidl("if (test_var < 0 || (unsigned long long)test_var > uint_max) {"); - $self->indent; - $self->pidl("PyErr_Format(PyExc_OverflowError, \"Expected type %s or %s within range 0 - %llu, got %ld\",\\"); - $self->pidl(" PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);"); - $self->pidl($fail); - $self->deindent; - $self->pidl("}"); - $self->pidl("$target = test_var;"); - $self->deindent; $self->pidl("} else {"); $self->indent; $self->pidl("PyErr_Format(PyExc_TypeError, \"Expected type %s or %s\",\\"); @@ -1806,19 +1793,6 @@ sub ConvertObjectFromPythonData($$$$$$;$$) $self->pidl("}"); $self->pidl("$target = test_var;"); $self->deindent; - $self->pidl("} else if (PyLong_Check($cvar)) {"); - $self->indent; - $self->pidl("long test_var;"); - $self->pidl("test_var = PyInt_AsLong($cvar);"); - $self->pidl("if (test_var < int_min || test_var > int_max) {"); - $self->indent; - $self->pidl("PyErr_Format(PyExc_OverflowError, \"Expected type %s or %s within range %lld - %lld, got %ld\",\\"); - $self->pidl(" PyInt_Type.tp_name, PyLong_Type.tp_name, int_min, int_max, test_var);"); - $self->pidl($fail); - $self->deindent; - $self->pidl("}"); - $self->pidl("$target = test_var;"); - $self->deindent; $self->pidl("} else {"); $self->indent; $self->pidl("PyErr_Format(PyExc_TypeError, \"Expected type %s or %s\",\\");