From b48331928225347aeee83af1bc3c1dee64205f9b Mon Sep 17 00:00:00 2001 From: "Amar Sood (tekacs)" Date: Sun, 5 Oct 2014 11:29:21 +0100 Subject: [PATCH] Update .sort to use key for Python 3.x. Rather than really dubious cmp function. --- gitlab | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/gitlab b/gitlab index 18885006e..7ddd48c54 100755 --- a/gitlab +++ b/gitlab @@ -131,13 +131,7 @@ def usage(): if gitlab.GitlabObject in getmro(o) and o != gitlab.GitlabObject: classes.append(o) - def s(a, b): - if a.__name__ < b.__name__: - return -1 - elif a.__name__ > b.__name__: - return 1 - - classes.sort(cmp=s) + classes.sort(key=lambda x: x.__name__) for cls in classes: print(" %s" % clsToWhat(cls))