From 3b1c9d6dd6c19b5ed8bb58eb79949d8da65ad524 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. --- packaging/apt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/apt b/packaging/apt index eb64f8701fb..f2c8d9ce4ed 100644 --- a/packaging/apt +++ b/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: