From 11e066b12768c789dbfd876447fbf52a322f7b41 Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Wed, 5 Aug 2020 20:39:37 +0200 Subject: security_db: don't use cmp to compare versions --- lib/python/security_db.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/python/security_db.py b/lib/python/security_db.py index 4f9597a376..18a77a1a8d 100644 --- a/lib/python/security_db.py +++ b/lib/python/security_db.py @@ -2070,10 +2070,8 @@ class DB: AND sp.release = binary_packages.release AND sp.archive = binary_packages.archive AND sp.version <> binary_packages.source_version"""): - relation = cmp(debian_support.Version(version), - debian_support.Version(source_version)) - assert relation != 0 - if relation <= 0: + assert debian_support.Version(version) != debian_support.Version(source_version) + if debian_support.Version(version) <= debian_support.Version(source_version): print("error: binary package is older than source package") else: print("warning: binary package is newer than source package") -- cgit v1.2.3