This will provide a different output format if pkgname is a list or not, what about:
````
 if not isinstance(pkgname, list):
    pkgname = [pkgname]
````