From 401070a618a036ed6295e5e1c1b925a66471f86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sat, 12 Sep 2009 17:52:23 +0200 Subject: Replace cmp. --HG-- branch : distribute extra : rebase_source : 3d8d4d289d13bbb9fb9c946e31282c578264f626 --- pkg_resources.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg_resources.py') diff --git a/pkg_resources.py b/pkg_resources.py index 910c3089..7c3d58fb 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -2466,8 +2466,9 @@ class Requirement: elif isinstance(item,basestring): item = parse_version(item) last = None + compare = lambda a, b: (a > b) - (a < b) # -1, 0, 1 for parsed,trans,op,ver in self.index: - action = trans[cmp(item,parsed)] + action = trans[compare(item,parsed)] # Indexing: 0, 1, -1 if action=='F': return False elif action=='T': return True elif action=='+': last = True -- cgit v1.2.1