summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorStefan Zimmermann <zimmermann.code@gmail.com>2014-03-31 15:21:40 +0000
committerStefan Zimmermann <zimmermann.code@gmail.com>2014-03-31 15:21:40 +0000
commite0fbcd722d8ce5f02552157196c7b2e45dc362ee (patch)
treebbc61ec90d436c8b470eb70bf9c09ed552261ef7 /bin
parent45771ceb5fe4a1817bff1526d71233af2c191ca2 (diff)
downloadscons-e0fbcd722d8ce5f02552157196c7b2e45dc362ee.tar.gz
More __cmp__ to __eq__ (and __lt__). Resolved some UnboundLocalErrors after except.
Diffstat (limited to 'bin')
-rw-r--r--bin/SConsDoc.py6
-rw-r--r--bin/scons-proc.py11
2 files changed, 12 insertions, 5 deletions
diff --git a/bin/SConsDoc.py b/bin/SConsDoc.py
index 80f41a58..72c03064 100644
--- a/bin/SConsDoc.py
+++ b/bin/SConsDoc.py
@@ -668,8 +668,10 @@ class Item(object):
if name[0] == '_':
name = name[1:]
return name.lower()
- def __cmp__(self, other):
- return cmp(self.sort_name, other.sort_name)
+ def __eq__(self, other):
+ return self.sort_name == other.sort_name
+ def __lt__(self, other):
+ return self.sort_name < other.sort_name
class Builder(Item):
pass
diff --git a/bin/scons-proc.py b/bin/scons-proc.py
index b93b25a8..138cff74 100644
--- a/bin/scons-proc.py
+++ b/bin/scons-proc.py
@@ -231,10 +231,15 @@ class Proxy(object):
"""Retrieve the entire wrapped object"""
return self.__subject
- def __cmp__(self, other):
+ def __eq__(self, other):
if issubclass(other.__class__, self.__subject.__class__):
- return cmp(self.__subject, other)
- return cmp(self.__dict__, other.__dict__)
+ return self.__subject == other
+ return self.__dict__ == other.__dict__
+
+ ## def __lt__(self, other):
+ ## if issubclass(other.__class__, self.__subject.__class__):
+ ## return self.__subject < other
+ ## return self.__dict__ < other.__dict__
class SConsThing(Proxy):
def idfunc(self):