Author: Matti Picus <matti.pi...@gmail.com> Branch: cpyext-hash_notimpl Changeset: r91710:217e03c35f1f Date: 2017-07-07 09:36 +0300 http://bitbucket.org/pypy/pypy/changeset/217e03c35f1f/
Log: fix for test, skip if not translated diff --git a/pypy/module/cpyext/test/test_typeobject.py b/pypy/module/cpyext/test/test_typeobject.py --- a/pypy/module/cpyext/test/test_typeobject.py +++ b/pypy/module/cpyext/test/test_typeobject.py @@ -1351,6 +1351,9 @@ class AppTestHashable(AppTestCpythonExtensionBase): def test_unhashable(self): + if not self.runappdirect: + skip('pointer to function equality available' + ' only after translation') module = self.import_extension('foo', [ ("new_obj", "METH_NOARGS", ''' diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py --- a/pypy/module/cpyext/typeobject.py +++ b/pypy/module/cpyext/typeobject.py @@ -347,12 +347,9 @@ if len(slot_names) == 1: func = getattr(pto, slot_names[0]) if slot_names[0] == 'c_tp_hash': - # XXX if it is hash_not_impl, do not assign to dict_w - # name = rffi.charp2str(pto.c_tp_name) - # if 'foo' in name: - # import pdb;pdb.set_trace() if hash_not_impl == func: - # XXX never reached + # special case for tp_hash == PyObject_HashNotImplemented + dict_w[method_name] = space.w_None continue else: assert len(slot_names) == 2 _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit