Fixes exit_on_exception with sys.error