summaryrefslogtreecommitdiff
path: root/django/dispatch
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-05-18 14:52:24 +0200
committerClaude Paroz <claude@2xlibre.net>2012-05-18 14:52:24 +0200
commitd04f72fb31bab43386e12963c1c6dec23ae16143 (patch)
tree9d675195f5afda5e4b9b17ba3741c51526969420 /django/dispatch
parent45f55a9fccaac3240826aa993aba4247310be331 (diff)
Got rid of old __cmp__methods replaced by rich comparison.
The __cmp__ methods are unsupported in Python 3. _doctest.py has been left untouched because it is likely it will not be migrated to Python 3.
Diffstat (limited to 'django/dispatch')
-rw-r--r--django/dispatch/saferef.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/django/dispatch/saferef.py b/django/dispatch/saferef.py
index e060e619f8..2a2c8739fb 100644
--- a/django/dispatch/saferef.py
+++ b/django/dispatch/saferef.py
@@ -155,12 +155,12 @@ class BoundMethodWeakref(object):
def __nonzero__( self ):
"""Whether we are still a valid reference"""
return self() is not None
-
- def __cmp__( self, other ):
+
+ def __eq__(self, other):
"""Compare with another reference"""
- if not isinstance (other,self.__class__):
- return cmp( self.__class__, type(other) )
- return cmp( self.key, other.key)
+ if not isinstance(other, self.__class__):
+ return self.__class__ == type(other)
+ return self.key == other.key
def __call__(self):
"""Return a strong reference to the bound method