Hi Yury, Yes I was afraid of that - I had expected a fuller emulation on the pypy side. It looks like the pypy C api is closer to python 2.x api and still somewhat incomplete w/r to python 3.x.
On the bright side, it appears that the older Perforce API (based on python 3.2.x) only needs PyByteArray_Type() and PyModule_GetState(). Here are my compile hacks: ---------------------------------------------------------------------------------- raspberrypi{pypylocal.72} diff -c include.orig/bytesobject.h include/bytesobject.h *** include.orig/bytesobject.h 2014-06-19 09:20:58.000000000 -0700 --- include/bytesobject.h 2014-08-10 10:14:53.686066499 -0700 *************** *** 16,23 **** Py_ssize_t size; } PyBytesObject; ! #define PyByteArray_Check(obj) \ ! PyObject_IsInstance(obj, (PyObject *)&PyByteArray_Type) #ifdef __cplusplus } --- 16,23 ---- Py_ssize_t size; } PyBytesObject; ! #define PyByteArray_Check(self) PyObject_TypeCheck(self, &PyByteArray_Type) ! PyAPI_FUNC(PyObject *) PyByteArray_FromStringAndSize(const char *, Py_ssize_t); #ifdef __cplusplus } raspberrypi{pypylocal.73} diff -c include.orig/moduleobject.h include/moduleobject.h *** include.orig/moduleobject.h 2014-06-19 09:20:58.000000000 -0700 --- include/moduleobject.h 2014-08-09 12:24:55.280748682 -0700 *************** *** 32,37 **** --- 32,39 ---- freefunc m_free; }PyModuleDef; + PyAPI_FUNC(void*) PyModule_GetState(PyObject*); + #ifdef __cplusplus } #endif ---------------------------------------------------------------------------------- How hard would that be to emulate those types? Would it be better to customize the api to comply with the "native" pypy interface? (Any pointers appreciated!) For the current Perforce API, based on python 3.3, there are additional requirements in the unicode area, which I believe reflect changes in Cpython itself between 3.2.x and 3.3.x. thanks, -Russ At 1:03 PM +0200 8/10/14, Yury V. Zaytsev wrote: >On Sat, 2014-08-09 at 13:27 -0700, Russ Tremain wrote: >> >> If I hack around the macro problems, I can get a compile, but then I >> get a runtime error: > >Hi Russ, > >The PyPy/C API (cpyext) is an incomplete implementation of Python/C API, >fitted to emulate the implementation details of CPython when possible, >often at a performance cost. > >It is not impossible that the functions that you are trying to use are >simply not implemented, and I've had such issues in the past. > >How are you "hacking" around macro problems? Simply declaring the macros >will not help, most likely you would also have to implement the >corresponding support code in PyPy. > >Hope that helps, > >-- >Sincerely yours, >Yury V. Zaytsev _______________________________________________ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev