Only add sorted if < 2.4.0

This commit is contained in:
Jeremy Fincher 2004-12-02 05:34:12 +00:00
parent f7a3504a93
commit 3904672c2f

View File

@ -431,7 +431,8 @@ def sortBy(f, L):
for (i, elt) in enumerate(L):
L[i] = L[i][2]
def sorted(iterable, cmp=None, key=None, reversed=False):
if sys.version_info < (2, 4, 0):
def sorted(iterable, cmp=None, key=None, reversed=False):
L = list(iterable)
if key is not None:
assert cmp is None, 'Can\'t use both cmp and key.'
@ -442,7 +443,7 @@ def sorted(iterable, cmp=None, key=None, reversed=False):
L.reverse()
return L
__builtins__['sorted'] = sorted
__builtins__['sorted'] = sorted
def mktemp(suffix=''):
"""Gives a decent random string, suitable for a filename."""