Commit 1d6e7063 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Get rid of old __cmp__ function

parent 0c58c7a2
......@@ -82,12 +82,12 @@ def uid(owner):
except KeyError:
raise KeyError("user '%s' not found" % owner)
def __cmp__(self, other):
def __eq__(self, other):
try:
return cmp(int(self), other)
return int(self) == other
except KeyError:
log(NORMAL, "Deferring uid lookup for '%s'" % owner)
return cmp(None, other)
return False
return deferred_uid()
......@@ -104,12 +104,12 @@ def gid(group):
except KeyError:
raise KeyError("group '%s' not found" % group)
def __cmp__(self, other):
def __eq__(self, other):
try:
return cmp(int(self), other)
return int(self) == other
except KeyError:
log(NORMAL, "Deferring gid lookup for '%s'" % group)
return cmp(None, other)
return False
return deferred_gid()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment