diff options
author | Colin D Bennett <colin.bennett@harman.com> | 2015-12-23 11:57:45 -0800 |
---|---|---|
committer | Colin D Bennett <colin.bennett@harman.com> | 2015-12-23 12:10:32 -0800 |
commit | 363b75e73c2b66ab625811accdb9d639fb068675 (patch) | |
tree | 3fa2f6f94fd713f1f8c93e86d2ef567582e6ec41 /gitlab/cli.py | |
parent | acc151190e32ddaf9198a10c5b816af2d36c0f19 (diff) | |
download | gitlab-363b75e73c2b66ab625811accdb9d639fb068675.tar.gz |
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()
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r-- | gitlab/cli.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gitlab/cli.py b/gitlab/cli.py index a1109b6..1f82498 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -21,6 +21,7 @@ from __future__ import division 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) |