Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Blomdell
mio
Commits
1d6e7063
Commit
1d6e7063
authored
Aug 30, 2019
by
Anders Blomdell
Browse files
Get rid of old __cmp__ function
parent
0c58c7a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/mio/util.py
View file @
1d6e7063
...
...
@@ -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
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment