Python Embedding Importing relative modules

Aahz aahz at pythoncraft.com
Tue Jul 6 17:29:20 EDT 2010


In article <33affa14-ded1-4742-a98f-c478df353352 at w31g2000yqb.googlegroups.com>,
moerchendiser2k3  <googler.1.webmaster at spamgourmet.com> wrote:
>
>Imagine I load them parallel so the GIL might interrupt the
>save-process of sys.modules,
>
>[ENSURE GIL]
>Load Script
>Save sys.modules
>[interrupt]
>Load Script
>Save sys.modules
>...
>
>so this might run into several other problems.

Very yes; if you're trying to maintain script independence, you should
either run them sequentially (so you can safely save/restore the
environment) or use processes.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you don't know what your program is supposed to do, you'd better not
start writing it."  --Dijkstra



More information about the Python-list mailing list