PyThreadState_SetAsyncExc, PyErr_Clear and boost::python

2006-05-10 Thread gabriel . becedillas
I use PyThreadState_SetAsyncExc to stop a python thread but there are situations when the thread doesn't stop and continues executing normally. After some debugging, I realized that the problem is that PyThreadState_SetAsyncExc was called when the thread was inside a native extension, that for some

PyThreadState_SetAsyncExc and native extensions

2006-04-25 Thread gabriel . becedillas
Does anyone know if PyThreadState_SetAsyncExc stops a thread while its inside a native extension ? I'm trying to stop a testing script that boils down to this: while True: print "aaa" native_extension_call() print "bbb" Using PyThreadState_SetAsyncExc the module doesn't stop but if I

Re: Replace a module variable with a function call

2006-02-06 Thread gabriel . becedillas
Tim and Carsten, Thank you very much for your replies. I'm afraid this is not going to work for me (but I'm not 100% sure), coz if I access those modules from the Python's C API (PyModule_* functions), the PyModule_Check() calls will fail. Thanks again. -- http://mail.python.org/mailman/listinfo/

Re: Replace a module variable with a function call

2006-02-06 Thread gabriel . becedillas
Your post didn't provide any help at all, it was a useless sarcastic post and I'm a very sensible person. -- http://mail.python.org/mailman/listinfo/python-list

Re: Replace a module variable with a function call

2006-02-06 Thread gabriel . becedillas
There are modules (like os) that define some stuff that depends on the platform (for example linesep). This platform dependent constants gets their values assigned when the module gets loaded, but in our application, different threads might run on different computers (by proxying syscalls).. and we

Replace a module variable with a function call

2006-02-06 Thread gabriel . becedillas
I have a module that defines a variable with a constant value and now I need to make that value dynamic, without affecting module clients. In other words, I need to call a function witout using parenthesis. Example: mymod.py-- def value(): return "hi" client.py---

Sharing between multiple interpreters and restricted mode

2006-01-04 Thread gabriel . becedillas
Hi, At the company I work for we've embedded Python 2.4.1 in a C++ application. We execute multiple scripts concurrenlty, each one in its own interpreter (created using Py_NewInterpreter()). We are sharing a certain instance between interpreters because its to expensive to instantiate that class ev