pidl: avoid py compile issues with --pidl-developer
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 8 Dec 2022 21:36:30 +0000 (10:36 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 3 Feb 2023 03:27:54 +0000 (03:27 +0000)
We get these warnings-as-errors:

librpc/gen_ndr/py_netlogon.c:61903:53: error: stray ‘\’ in program
61903 |    PyErr_Format(PyExc_TypeError, "Expected type %s",\  //<PIDL> Parse::Pidl::Samba4::Python::ConvertObjectFromPythonData  lib/Parse/Pidl/Samba4/Python.pm:2005

but the '\' is unnecessary and unconventional anyway, since we're in a
function argument list.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Feb  3 03:27:54 UTC 2023 on atb-devel-224

pidl/lib/Parse/Pidl/Samba4/Python.pm

index 5c4d3e8e0877a713dabc50296fb503f662b3318d..03a901cc24dc407ab64d2d9a035b3f81e86bad17 100644 (file)
@@ -1747,7 +1747,7 @@ sub ConvertObjectFromPythonData($$$$$$;$$)
                $self->pidl("}");
                $self->pidl("if (test_var > uint_max) {");
                $self->indent;
-               $self->pidl("PyErr_Format(PyExc_OverflowError, \"Expected type %s within range 0 - %llu, got %llu\",\\");
+               $self->pidl("PyErr_Format(PyExc_OverflowError, \"Expected type %s within range 0 - %llu, got %llu\",");
                $self->pidl("  PyLong_Type.tp_name, uint_max, test_var);");
                $self->pidl($fail);
                $self->deindent;
@@ -1756,7 +1756,7 @@ sub ConvertObjectFromPythonData($$$$$$;$$)
                $self->deindent;
                $self->pidl("} else {");
                $self->indent;
-               $self->pidl("PyErr_Format(PyExc_TypeError, \"Expected type %s\",\\");
+               $self->pidl("PyErr_Format(PyExc_TypeError, \"Expected type %s\",");
                $self->pidl("  PyLong_Type.tp_name);");
                $self->pidl($fail);
                $self->deindent;
@@ -1786,7 +1786,7 @@ sub ConvertObjectFromPythonData($$$$$$;$$)
                $self->pidl("}");
                $self->pidl("if (test_var < int_min || test_var > int_max) {");
                $self->indent;
-               $self->pidl("PyErr_Format(PyExc_OverflowError, \"Expected type %s within range %lld - %lld, got %lld\",\\");
+               $self->pidl("PyErr_Format(PyExc_OverflowError, \"Expected type %s within range %lld - %lld, got %lld\",");
                $self->pidl("  PyLong_Type.tp_name, int_min, int_max, test_var);");
                $self->pidl($fail);
                $self->deindent;
@@ -1795,7 +1795,7 @@ sub ConvertObjectFromPythonData($$$$$$;$$)
                $self->deindent;
                $self->pidl("} else {");
                $self->indent;
-               $self->pidl("PyErr_Format(PyExc_TypeError, \"Expected type %s\",\\");
+               $self->pidl("PyErr_Format(PyExc_TypeError, \"Expected type %s\",");
                $self->pidl("  PyLong_Type.tp_name);");
                $self->pidl($fail);
                $self->deindent;