Skip to content

Commit 3d7af67

Browse files
use reverse=True instead of negative comparator
1 parent a5fe89d commit 3d7af67

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pyrepl/module_lister.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,7 @@ def _make_module_list_dir(dir, suffs, prefix=''):
4545
def _make_module_list():
4646
import imp
4747
suffs = [x[0] for x in imp.get_suffixes() if x[0] != '.pyc']
48-
def compare(x, y):
49-
c = -cmp(len(x), len(y))
50-
if c:
51-
return c
52-
else:
53-
return -cmp(x, y)
54-
suffs.sort(compare)
48+
suffs.sort(reverse=True)
5549
_packages[''] = list(sys.builtin_module_names)
5650
for dir in sys.path:
5751
if dir == '':

0 commit comments

Comments
 (0)