[pypy-dev] Compiling pypy with python2.5

Armin Rigo arigo at tunes.org
Fri Mar 23 22:04:39 CET 2007

Hi Amaury,

On Fri, Mar 23, 2007 at 09:48:33PM +0100, Armin Rigo wrote:
> Amaury, the import from 'pypy.lib.struct' that your patch introduced in
> an 'app_*' module looks suspicious...  I'm not sure why we are not
> automatically picking up struct.py from pypy/lib/ from app-level code.

Ah yes, a theory is as follows: geninterp tries to add pypy/lib/ in
front of sys.path so that when it executes app_array.py directly on top
of CPython the modules over there get found (that's a bit of a hack,
really).  But in CPython, 'import struct' always pick up the built-in
struct module if it is really a built-in and not an extension module.
So the hack may fail if we're running on top of a CPython with a
built-in struct module.

This could be solved with a counter-hack: try adding a file
pypy/module/array/struct.py with the content:

    from pypy.lib.struct import *

A bientot,


More information about the Pypy-dev mailing list