Author: Ronny Pfannschmidt <[email protected]>
Branch:
Changeset: r188:a6cab4ec445c
Date: 2012-05-03 17:50 +0200
http://bitbucket.org/pypy/pyrepl/changeset/a6cab4ec445c/
Log: use reverse=True instead of negative comparator
diff --git a/pyrepl/module_lister.py b/pyrepl/module_lister.py
--- a/pyrepl/module_lister.py
+++ b/pyrepl/module_lister.py
@@ -45,13 +45,7 @@
def _make_module_list():
import imp
suffs = [x[0] for x in imp.get_suffixes() if x[0] != '.pyc']
- def compare(x, y):
- c = -cmp(len(x), len(y))
- if c:
- return c
- else:
- return -cmp(x, y)
- suffs.sort(compare)
+ suffs.sort(reverse=True)
_packages[''] = list(sys.builtin_module_names)
for dir in sys.path:
if dir == '':
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit