We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 498a53e commit fa8a5dfCopy full SHA for fa8a5df
src/polyfills/stdlib/functions.py
@@ -127,9 +127,9 @@ def cmp(a, b):
127
elements.sort()
128
else:
129
# The `key` argument was introduced starting from Python 2.4
130
- if _sys.version_info >= (2, 4):
+ try:
131
elements.sort(key=key)
132
- else:
+ except TypeError:
133
# Convert the key function to a cmp function, since the `key` argument is not available.
134
elements.sort(key_to_cmp(key))
135
0 commit comments