summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-10 04:49:10 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-10 04:49:10 +0000
commit308daa12820bb4b41c5bcb097da1763a2867518c (patch)
treed7ea09f45709b9b814601603485673bcb384e725 /pym
parent7f1562aa8272e91a01f951fbab804a006a3324f1 (diff)
downloadportage-308daa12820bb4b41c5bcb097da1763a2867518c.tar.gz
portage-308daa12820bb4b41c5bcb097da1763a2867518c.tar.bz2
portage-308daa12820bb4b41c5bcb097da1763a2867518c.zip
Simplify cmp_sort_key._cmp_key.__lt__().
svn path=/main/trunk/; revision=12817
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/util.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/pym/portage/util.py b/pym/portage/util.py
index a881bd77f..c78c3b2f9 100644
--- a/pym/portage/util.py
+++ b/pym/portage/util.py
@@ -668,12 +668,10 @@ class cmp_sort_key(object):
self._obj = obj
def __lt__(self, other):
- if not isinstance(other, self.__class__):
+ if other.__class__ is not self.__class__:
raise TypeError("Expected type %s, got %s" % \
(self.__class__, other.__class__))
- if self._cmp_func(self._obj, other._obj) < 0:
- return True
- return False
+ return self._cmp_func(self._obj, other._obj) < 0
def unique_array(s):
"""lifted from python cookbook, credit: Tim Peters