Skip to content

Commit

Permalink
Whack dem moles.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Dec 26, 2014
1 parent 30d1f2e commit 671092c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions BTrees/_base.py
Expand Up @@ -215,8 +215,12 @@ def _no_default_comparison(key):
raise TypeError("Can't use object() as keys")
lt = getattr(key, '__lt__', 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
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
getattr(key, '__cmp__', None) is None):
raise TypeError("Can't use default __cmp__")
Expand Down

0 comments on commit 671092c

Please sign in to comment.