[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyKDE] Importing sip-generated module into multiple interpreters
From:       Nigel Stewart <ns () fluent ! com>
Date:       2005-08-31 22:29:39
Message-ID: 43162F53.9080109 () fluent ! com
[Download RAW message or body]

Hi,

I'm trying to encapsulate a script into
a seperate Python interpreter.  The idea
is that these scripts are safely
isolated from the rest of the system,
except for our sip-generated "module" API.

1    Py_BEGIN_ALLOW_THREADS

2    PyThreadState *pi =  Py_NewInterpreter();
3    initsip();
4    initmodule();
5    PyRun_SimpleString("...");
6    Py_EndInterpreter(pi);

7    Py_END_ALLOW_THREADS

I get the following error in response to line 4,
perhaps sip isn't designed to deal with multiple
interpreters?

RuntimeError: the sip module has already registered a module called icecore

Any info would be appreciated, especially if
there is another way to achieve a sandbox sharing
the same interpreter.

Regards,

Nigel Stewart

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic