[pypy-dev] "import signal" fails when running PyPy interpreted

Stefan Behnel stefan_ml at behnel.de
Mon Mar 12 10:21:14 CET 2012

Amaury Forgeot d'Arc, 12.03.2012 09:37:
> 2012/3/12 Stefan Behnel:
>>> It's tersely documented in pypy/doc/coding_guide.rst.
>> I read this a little closer now and it told me more or less what I expected
>> when I skipped over it for the first time. It tells me that "PyPy can be
>> debugged on top of CPython", which is (in friendly words) only true if you
>> are prepared to fire it up before going to bed to get the results the next
>> morning. I thought we had to 60's for that.
> Did we tell you that cpyext was slow? :-)

Oh, believe me, I'd be happy if everything was running in C and only using
cpyext. As I said in another mail, however, the C code parts here are
totally negligible - they are just short tests. It's the test runner that
takes ages to get started.

Is there a way to manually compile a C module against a PyPy-in-sources
that allows importing it afterwards? Then I could just compile the test
normally (and quickly) in CPython and then recompile the C code manually
for PyPy. I tried, but it didn't work so far. What I tried was:

1) run gcc directly - fails because the header files were not in place

2) copy header files from pypy/modules/cpyext/include/ to plain include/
and compile - still fails because pypy_decl.h and pypy_macros.h are missing

3) copy header files from pre-built PyPy - compiles now, but doesn't get
found - PyPy looks for "modname.pypy-18i.so" only and ignores "modname.so"

4) rename .so name to .pypy-18i.so - module is found but still fails to
import with

ImportError: unable to load extension module

Would be helpful to see a reason after the ":".

> In this case, I don't try to run unittest or doctest.

That explains the huge difference.


More information about the pypy-dev mailing list