diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-03-11 07:44:52 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-03-11 07:44:52 +0000 |
commit | 7a894c74f7efcb7d42e90d46a31578bd2e71c2e4 (patch) | |
tree | 3c4bc420145db306c7c9f35bd7575338bac20106 | |
parent | b13c86c7e6dc3a9d0b89cf0921a07c2e296e4db5 (diff) | |
download | portage-7a894c74f7efcb7d42e90d46a31578bd2e71c2e4.tar.gz portage-7a894c74f7efcb7d42e90d46a31578bd2e71c2e4.tar.bz2 portage-7a894c74f7efcb7d42e90d46a31578bd2e71c2e4.zip |
Simplify cmp_sort_key._cmp_key.__lt__(). (trunk r12817)
svn path=/main/branches/2.1.6/; revision=13049
-rw-r--r-- | pym/portage/util.py | 6 |
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 |