[pypy-dev] prevent extension module code from being executed during startup?

Armin Rigo arigo at tunes.org
Sat Mar 30 18:25:11 CET 2013


Hi Wim,

On Sat, Mar 30, 2013 at 5:40 PM,  <wlavrijsen at lbl.gov> wrote:
> -        'gbl'                    : 'pythonify.gbl',
> can not be removed, as w/o it 'gbl' will not show up at the module level.

Ah I see, pythonify.py does "sys.modules['cppyy.gbl'] = gbl".  I
somehow misread that.  It should also do in the same place "cppyy.gbl
= gbl" to force the value to show up when this initialization code
runs.

> But again, the real problem is that startup() still runs immediately when I
> type './pypy-c' and not when 'import cppyy' later on the prompt

Uh, that's strange.  The docstrings in interpreter/module.py say
specifically the opposite.  But the truth looks a bit more complicated
indeed, e.g. it depends if getbuiltinmodule('cppyy') was already
called during translation or not...


A bientôt,

Armin.


More information about the pypy-dev mailing list