From c30c4a48fd7b77f19643ce562d91b54cfaf2b7e4 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Feb 21 2020 08:44:52 +0000 Subject: PR#751: xmlrpcplus: use parent Marshaller's implementations where possible Merges #751 https://pagure.io/koji/pull-request/751 Fixes: https://pagure.io/koji/issue/1538 --- diff --git a/koji/xmlrpcplus.py b/koji/xmlrpcplus.py index a3d18a6..e24d415 100644 --- a/koji/xmlrpcplus.py +++ b/koji/xmlrpcplus.py @@ -47,16 +47,9 @@ class ExtendedMarshaller(xmlrpc_client.Marshaller): write(str(int(value))) write("\n") else: - write("") - write(str(int(value))) - write("\n") + return xmlrpc_client.Marshaller.dump_int(self, value, write) dispatch[int] = dump_int - # we always want to allow None - def dump_nil(self, value, write): - write("") - dispatch[type(None)] = dump_nil - if six.PY2: ExtendedMarshaller.dispatch[long] = ExtendedMarshaller.dump_int @@ -84,9 +77,9 @@ def dumps(params, methodname=None, methodresponse=None, encoding=None, encoding = "utf-8" if marshaller is not None: - m = marshaller(encoding) + m = marshaller(encoding, allow_none=True) else: - m = ExtendedMarshaller(encoding) + m = ExtendedMarshaller(encoding, allow_none=True) data = m.dumps(params)