From 849aab0a12e21947b82a0b5c9f8c8a9528557a96 Mon Sep 17 00:00:00 2001 From: Rene Moser Date: Thu, 16 Jan 2014 10:48:35 +0100 Subject: [PATCH] apt: fixed pkg== fails if package is not yet installed. Reported and patch provided by https://github.com/msolo. Closes GH-5625. --- library/packaging/apt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/packaging/apt b/library/packaging/apt index eb64f8701f..f2c8d9ce4e 100644 --- a/library/packaging/apt +++ b/library/packaging/apt @@ -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: