Author: Matti Picus <[email protected]>
Branch: py3.5
Changeset: r94142:c9ce25047019
Date: 2018-03-27 01:10 +0300
http://bitbucket.org/pypy/pypy/changeset/c9ce25047019/
Log: fix test, implement userslot for __call__ needed for python-defined
class
diff --git a/pypy/module/cpyext/test/test_cpyext.py
b/pypy/module/cpyext/test/test_cpyext.py
--- a/pypy/module/cpyext/test/test_cpyext.py
+++ b/pypy/module/cpyext/test/test_cpyext.py
@@ -364,7 +364,7 @@
self.unimport_module(name)
self.cleanup()
state = self.space.fromcache(State)
- assert not state.operror
+ assert 'operror' not in dir(state)
class AppTestCpythonExtension(AppTestCpythonExtensionBase):
diff --git a/pypy/module/cpyext/userslot.py b/pypy/module/cpyext/userslot.py
--- a/pypy/module/cpyext/userslot.py
+++ b/pypy/module/cpyext/userslot.py
@@ -49,6 +49,11 @@
w_stararg=w_args, w_starstararg=w_kwds)
return space.call_args(w_impl, args)
+@slot_function([PyObject, PyObject, PyObject], PyObject)
+def slot_tp_call(space, w_self, w_args, w_kwds):
+ args = Arguments(space, [], w_stararg=w_args, w_starstararg=w_kwds)
+ return space.call_args(w_self, args)
+
# unary functions
@slot_function([PyObject], PyObject)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit