threads and exception in wxPython

Peter Hansen peter at engcorp.com
Wed Nov 3 15:24:37 EST 2004


Thomas Heller wrote:
> Peter Hansen <peter at engcorp.com> writes:
>>I have a test case here which is failing, however, because
>>the exception is *not* being delivered asynchronously for
>>some reason, but appears in the thread only when the thread
>>is already terminating itself.  
> 
> Can it be that the exception is delivered asynchronously, but still has
> to be checked by some code somewhere (my guess would be ceval.c)?
> It seems sys.setcheckinterval() plays a role here.

Exactly!  That is definitely it.  I was sitting in a small
loop doing a time.sleep() every so often, and during the
entire test that thread probably executed only about forty
or fifty bytecodes.

Your technique with the "busy loop" works, as does setting
sys.setcheckinterval() to a much smaller value than the
default 100.

Thanks Thomas!

-Peter



More information about the Python-list mailing list