From: Zac Medico Date: Wed, 10 Dec 2008 17:41:36 +0000 (-0000) Subject: For py3k compat, remove Atom.__cmp__() and use str.__lt__() instead. X-Git-Tag: v2.2_rc18~25 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=808bb16be82d1c92b6f8c037b76e434e38a52810;p=portage.git For py3k compat, remove Atom.__cmp__() and use str.__lt__() instead. svn path=/main/trunk/; revision=12199 --- diff --git a/pym/portage/dep.py b/pym/portage/dep.py index c17602117..9c9c14380 100644 --- a/pym/portage/dep.py +++ b/pym/portage/dep.py @@ -509,7 +509,8 @@ class Atom(object): _str_methods = ("endswith", "find", "index", "lstrip", "replace", "startswith", "split", "strip", "rindex", "rfind", "rstrip", "__getitem__", - "__eq__", "__hash__", "__len__", "__ne__", "__repr__", "__str__") + "__eq__", "__hash__", "__len__", "__lt__", + "__ne__", "__repr__", "__str__") __slots__ = ("__weakref__", "blocker", "cp", "cpv", "operator", "slot", "use") + _str_methods @@ -556,15 +557,6 @@ class Atom(object): use = None obj_setattr(self, "use", use) - def __cmp__(self, other): - self_str = str(self) - other_str = str(other) - if self_str == other_str: - return 0 - if self_str > other_str: - return 1 - return -1 - def __setattr__(self, name, value): raise AttributeError("Atom instances are immutable", self.__class__, name, value)