From 363b75e73c2b66ab625811accdb9d639fb068675 Mon Sep 17 00:00:00 2001 From: Colin D Bennett Date: Wed, 23 Dec 2015 11:57:45 -0800 Subject: [PATCH] Use name as sort key to fix Python 3 TypeError Sort types explicitly by name to fix unorderable types TypeError in Python 3. The call to sort() on cli.py line 259 produced the error: TypeError: unorderable types: type() < type() --- gitlab/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gitlab/cli.py b/gitlab/cli.py index a1109b67e..1f824986e 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -21,6 +21,7 @@ from __future__ import absolute_import import argparse import inspect +import operator import re import sys @@ -256,7 +257,7 @@ def main(): classes.append(cls) except AttributeError: pass - classes.sort() + classes.sort(key=operator.attrgetter("__name__")) for cls in classes: arg_name = clsToWhat(cls)