]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pidl: Remove duplicate "if (PyLong_Check($cvar)" clauses
authorAndrew Bartlett <abartlet@samba.org>
Sat, 14 Mar 2020 21:10:24 +0000 (10:10 +1300)
committerNoel Power <npower@samba.org>
Mon, 23 Mar 2020 19:12:43 +0000 (19:12 +0000)
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>
pidl/lib/Parse/Pidl/Samba4/Python.pm

index b2a65cc7376f73cb3640d0485406a97a07300913..6cd85d1a36ce32f2347bf1364597cc6eaf0f15e8 100644 (file)
@@ -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\",\\");