##### SUMMARY
Happened here: https://github.com/ansible-collections/community.general/pull/341

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
ansible-test

##### ANSIBLE VERSION
```paste below
devel
```

installed, version_ok, upgradable, has_files = package_status(m, package.name, version, cache, state='install')
                        if installed:
                            is_installed = True
                    return is_installed, version_ok, upgradable, False
                m.fail_json(msg="No package matching '%s' is available" % pkgname)
            except AttributeError:
                # py
                # ma
                return False, False, True, False
        else:
            return False, False, False, False
    try:
        has_files = len(pkg.installed_files) > 0
    except UnicodeDecodeError:
        has_files = True
    except AttributeError:
        has_files = False  # ol
    try:
        package_is_installed = ll_pkg.current_state == apt_pkg.CURSTATE_INSTALLED
    except AttributeError:  # py
        try:
            # mi
            package_is_installed = pkg.is_installed
        except AttributeError:
            # as
            package_is_installed = pkg.isInstalled
    version_is_installed = package_is_installed
    if version:
        versions = package_versions(pkgname, pkg, cache._cache)
        avail_upgrades = fnmatch.filter(versions, version)