apt: fixed pkg=<name>=<version> fails if package is not yet installed.

Reported and patch provided by https://github.com/msolo. Closes GH-5625.
This commit is contained in:
Rene Moser 2014-01-16 10:48:35 +01:00
parent cf359df1c5
commit 3b1c9d6dd6

View file

@ -191,7 +191,7 @@ def package_status(m, pkgname, version, cache, state):
# assume older version of python-apt is installed
package_is_installed = pkg.isInstalled
if version:
if version and package_is_installed:
try:
installed_version = pkg.installed.version
except AttributeError: