diff options
author | Andrew Bartlett <abartlet@samba.org> | 2020-03-15 10:10:24 +1300 |
---|---|---|
committer | Noel Power <npower@samba.org> | 2020-03-23 19:12:43 +0000 |
commit | 79044e966cbe44d60997ecbd4b44f07305d99ac2 (patch) | |
tree | e3ff5878ab02915ff3413c563bac939580a5220e /pidl | |
parent | 3aea3b15381857bf3e9a69477c487c91f1b6cbbd (diff) | |
download | samba-79044e966cbe44d60997ecbd4b44f07305d99ac2.tar.gz |
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 <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Diffstat (limited to 'pidl')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/Python.pm | 26 |
1 files changed, 0 insertions, 26 deletions
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\",\\"); |