Skip to content

Commit

Permalink
Work around lack of '__objclass__' on instance methods in PyPy3.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Dec 26, 2014
1 parent 8af9222 commit 86e5b1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions BTrees/_base.py
Expand Up @@ -209,6 +209,10 @@ def advance(self):

def _no_default_comparison(key):
# Enforce test that key has non-default comparison.
if key is None:
raise TypeError("Can't use None as a key")
if type(key) is object:
raise TypeError("Can't use object() as keys")
lt = getattr(key, '__lt__', None)
if lt is not None:
if getattr(lt, '__objclass__', None) is object: #pragma NO COVER Py3k
Expand Down

0 comments on commit 86e5b1d

Please sign in to comment.