# Path: bugzilla/_util.py
# def listify(val):
#     """Ensure that value is either None or a list, converting single values
#     into 1-element lists"""
#     if val is None:
#         return val
#     if isinstance(val, list):
#         return val
#     return [val]


from logging import getLogger
from xmlrpc.client import (Binary, Fault, ProtocolError,
                           ServerProxy, Transport)
from requests import RequestException
from ._backendbase import _BackendBase
from .exceptions import BugzillaError
from ._util import listify
import sys
        log.debug("XMLRPC call: %s(%s)", methodname, newparams)
        authparams = self.__bugzillasession.get_auth_params()
        authparams.update(newparams)

        # pylint: disable=no-member
        ret = ServerProxy._ServerProxy__request(
            self, methodname, (authparams,))
        # pylint: enable=no-member

        return ret


class _BackendXMLRPC(_BackendBase):
    """
    Internal interface for direct calls to bugzilla's XMLRPC API
    """
    def __init__(self, url, bugzillasession):
        _BackendBase.__init__(self, url, bugzillasession)
        self._xmlrpc_proxy = _BugzillaXMLRPCProxy(url, self._bugzillasession)

    def get_xmlrpc_proxy(self):
        return self._xmlrpc_proxy
    def is_xmlrpc(self):
        return True

    def bugzilla_version(self):
        return self._xmlrpc_proxy.Bugzilla.version()

    def bug_attachment_get(self, attachment_ids, paramdict):
        data = paramdict.copy()

# Path: bugzilla/_util.py
# def listify(val):
#     """Ensure that value is either None or a list, converting single values
#     into 1-element lists"""
#     if val is None:
#         return val
#     if isinstance(val, list):
#         return val
#     return [val]


# Path: bugzilla/_backendxmlrpc.py
from logging import getLogger
from xmlrpc.client import (Binary, Fault, ProtocolError,
                           ServerProxy, Transport)
from requests import RequestException
from ._backendbase import _BackendBase
from .exceptions import BugzillaError
from ._util import listify
import sys

        log.debug("XMLRPC call: %s(%s)", methodname, newparams)
        authparams = self.__bugzillasession.get_auth_params()
        authparams.update(newparams)

        # pylint: disable=no-member
        ret = ServerProxy._ServerProxy__request(
            self, methodname, (authparams,))
        # pylint: enable=no-member

        return ret


class _BackendXMLRPC(_BackendBase):
    """
    Internal interface for direct calls to bugzilla's XMLRPC API
    """
    def __init__(self, url, bugzillasession):
        _BackendBase.__init__(self, url, bugzillasession)
        self._xmlrpc_proxy = _BugzillaXMLRPCProxy(url, self._bugzillasession)

    def get_xmlrpc_proxy(self):
        return self._xmlrpc_proxy
    def is_xmlrpc(self):
        return True

    def bugzilla_version(self):
        return self._xmlrpc_proxy.Bugzilla.version()

    def bug_attachment_get(self, attachment_ids, paramdict):
        data = paramdict.copy()

        data["attachment_ids"] = listify(attachment_ids)