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?
Thanks
--david

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

#include <assert.h>

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


_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to