For py3k compat, remove Atom.__cmp__() and use str.__lt__() instead.
authorZac Medico <zmedico@gentoo.org>
Fri, 12 Dec 2008 21:39:35 +0000 (21:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 12 Dec 2008 21:39:35 +0000 (21:39 -0000)
(trunk r12199)

svn path=/main/branches/2.1.6/; revision=12232

pym/portage/dep.py

index c176021174a2286464ade7c5cfec680cff18df94..9c9c1438090054e1983e63881ea3f56f73741f1a 100644 (file)
@@ -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)