The Boost libraries in their test jigs use a mixture of an embedded API and 
direct access to the  methods in Python.h.
Below is an example which compiles with  the py3.5 branch, correctly prints 
“hello world” but then faults with an message:
“Invalid RPython operation (NULL ptr or bad array index)”.

Is this kind of mixing of the two interfaces supported?

#include <Python.h>
#include <PyPy.h>

#include <assert.h>

int main() {
  int err = pypy_setup_home((char*)"/home/dcallahan/local/pypy",
  pypy_execute_source("print('hello world')");
  const char *s = "'abcdefg'.upper()";
  PyObject *obj = ::PyUnicode_FromString(s);
  return 0;

pypy-dev mailing list

Reply via email to