Py2.4: SystemExit in async_wrapper is not an error - compatibility fix

Prior to Python 2.5, SystemExit was a subclass of Exception.
In Py2.4, this is causing extra error output on valid sys.exit(0).

(Toshio) Call sys.exit from inside of the SystemExit exception handler so py2.4 and py2.5+ behaviour matches
pull/18777/head
Brano Zarnovican 9 years ago committed by Matt Clay
parent 079948eef0
commit 9fd52ac40e

@ -199,6 +199,12 @@ if __name__ == '__main__':
notice("Module complete (%s)"%os.getpid())
sys.exit(0)
except SystemExit:
# On python2.4, SystemExit is a subclass of Exception.
# This block makes python2.4 behave the same as python2.5+
e = get_exception()
sys.exit(e.code)
except Exception:
e = get_exception()
notice("error: %s"%(e))

Loading…
Cancel
Save