Commit 671092c3 authored by Tres Seaver's avatar Tres Seaver

Whack dem moles.

parent 30d1f2e7
...@@ -215,8 +215,12 @@ def _no_default_comparison(key): ...@@ -215,8 +215,12 @@ def _no_default_comparison(key):
raise TypeError("Can't use object() as keys") raise TypeError("Can't use object() as keys")
lt = getattr(key, '__lt__', None) lt = getattr(key, '__lt__', None)
if lt is not None: if lt is not None:
# CPython 3.x follows PEP 252, defining '__objclass__'
if getattr(lt, '__objclass__', None) is object: #pragma NO COVER Py3k if getattr(lt, '__objclass__', None) is object: #pragma NO COVER Py3k
lt = None lt = None
# PyPy3 doesn't follow PEP 252, but defines '__func__'
elif getattr(lt, '__func__', None) is object.__lt__: # pragma NO COVER
lt = None
if (lt is None and if (lt is None and
getattr(key, '__cmp__', None) is None): getattr(key, '__cmp__', None) is None):
raise TypeError("Can't use default __cmp__") raise TypeError("Can't use default __cmp__")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment