gangesmaster wrote:

> calling sys.exit() from a thread does nothing... the thread dies, but
> the interpreter remains. i guess the interpreter just catches and
> ignore the SystemExit exception...
> 
> does anybody know of a way to overcome this limitation? 
> 


call thread.interrupt_main()

on *NIX:  os.kill(os.getpid(),signal.XXXX)

or best design your threading correctly with resonable/flexible 
communication channels, e.g. CallQueue:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491281

(infact that latter (example2) uses sys.exit/SystemExit the other way 
correctly: to terminate a thread cleanly in functional style. in the 
same style reverse the mainthread could be terminated cleanly.)

I'd

-robert

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to