sys.exit behaviour on gevent 1.0

190 views
Skip to first unread message

Iwan Budi Kusnanto

unread,
Jan 30, 2012, 2:47:09 AM1/30/12
to gev...@googlegroups.com
Hi,
I just noticed that if we call sys.exit(-1) in gevent 1.0 then all
greenlet will die.
In 0.13, only greenlet that call it will die.
Is it intended?

Thanks

Denis Bilenko

unread,
Jan 30, 2012, 4:31:49 AM1/30/12
to gev...@googlegroups.com

Yes, SystemExit, SystemError and KeyboardInterrupt are now re-raised
in the MAIN greenlet if not caught. You can control this behaviour
with SYSTEM_ERROR attribute of the hub:

>>> gevent.get_hub().SYSTEM_ERROR
(<type 'exceptions.KeyboardInterrupt'>, <type
'exceptions.SystemExit'>, <type 'exceptions.SystemError'>

Reply all
Reply to author
Forward
0 new messages