diff options
Diffstat (limited to 'plugins/backend/zypppkgmgr.py')
-rw-r--r-- | plugins/backend/zypppkgmgr.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/backend/zypppkgmgr.py b/plugins/backend/zypppkgmgr.py index 7822904..b95f9bd 100644 --- a/plugins/backend/zypppkgmgr.py +++ b/plugins/backend/zypppkgmgr.py @@ -20,6 +20,7 @@ import shutil import urllib.parse import rpm import glob +import functools import zypp #pylint: disable=import-error if not hasattr(zypp, 'PoolQuery') or \ @@ -226,7 +227,7 @@ class Zypp(BackendPlugin): for pitem in sorted( q.queryResults(self.Z.pool()), - cmp=lambda x,y: cmpEVR(zypp.asKindPackage(x), zypp.asKindPackage(y)), + key=functools.cmp_to_key(lambda x,y: cmpEVR(zypp.asKindPackage(x), zypp.asKindPackage(y))), reverse=True): item = zypp.asKindPackage(pitem) if item.name() in list(self.excpkgs.keys()) and \ @@ -254,7 +255,7 @@ class Zypp(BackendPlugin): for pitem in sorted( q.queryResults(self.Z.pool()), - cmp=lambda x,y: cmpEVR(zypp.asKindPackage(x), zypp.asKindPackage(y)), + key=functools.cmp_to_key(lambda x,y: cmpEVR(zypp.asKindPackage(x), zypp.asKindPackage(y))), reverse=True): item = zypp.asKindPackage(pitem) if item.name() in list(self.excpkgs.keys()) and \ @@ -303,7 +304,7 @@ class Zypp(BackendPlugin): """collect packages should not be installed""" self.to_deselect.append(pkg) - def selectGroup(self, grp, include = ksparser.GROUP_DEFAULT): + def selectGroup(self, grp, include = ksparser.constants.GROUP_DEFAULT): def compareGroup(pitem): item = zypp.asKindPattern(pitem) return item.repoInfo().priority() @@ -734,8 +735,8 @@ class Zypp(BackendPlugin): for problem in probs: msger.warning("repo problem: %s, %s" \ - % (problem.description().decode("utf-8"), - problem.details().decode("utf-8"))) + % (problem.description(), + problem.details())) raise RepoError("found %d resolver problem, abort!" \ % len(probs)) |