Skip to content

Commit b483319

Browse files
committed
Update .sort to use key for Python 3.x.
Rather than really dubious cmp function.
1 parent 6c4fc34 commit b483319

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

gitlab

+1-7
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,7 @@ def usage():
131131
if gitlab.GitlabObject in getmro(o) and o != gitlab.GitlabObject:
132132
classes.append(o)
133133

134-
def s(a, b):
135-
if a.__name__ < b.__name__:
136-
return -1
137-
elif a.__name__ > b.__name__:
138-
return 1
139-
140-
classes.sort(cmp=s)
134+
classes.sort(key=lambda x: x.__name__)
141135
for cls in classes:
142136
print(" %s" % clsToWhat(cls))
143137

0 commit comments

Comments
 (0)