[pypy-dev] Python Execution Contexts Ch.2

Skip Montanaro skip at pobox.com
Tue Mar 26 20:27:43 CET 2013


>> 3. Now the problem. When I run execfile() without parameters, I expect the
>> code inside to be 'virtualized' - isolated from parent process, like in LXC
>> or VirtualBox, but on Python level.

> No, the code is not isolated from the parent. When you call execfile only
> with a filename, globals is set tho the caller's globals, and locals are set
> to the caller's locals!

Though this is just an educated guess, reading Anatoly's note and
Amaury's response leads me to think that Anatoly might be expecting
the execfile() function to work more or less like the exec* system
calls on Unix systems.  Execfile() is more akin to the import
statement than the fork/exec paradigm.

Skip


More information about the pypy-dev mailing list