[Twisted-Python] wxReactor Issues

Itamar Turner-Trauring itamar at itamarst.org
Tue Nov 16 22:39:26 EST 2010


On Tue, 2010-11-16 at 16:29 -0800, RSGames Support wrote:
> Hi,
> I have found something interesting. When I do not call sys.exit(), and just call this:  reactor.callFromThread(reactor.stop), the program exits properly. I was wondering if it was safe to not call sys.exit()? If so I think the problem is fixed.

sys.exit() will raise an exception, SystemExit. It's certainly possible
that raising it will cause problems, though I wouldn't expect it to keep
threads from exiting. It's possible there's some race condition involved
that is less likely to happen due to this change. Regardless, You should
not call it if you're using Twisted (or if you do, it should be called
after reactor.run()).




More information about the Twisted-Python mailing list