Merge "Provide an exit code when raising SystemExit."

This commit is contained in:
Zuul 2024-08-01 09:59:03 +00:00 committed by Gerrit Code Review
commit beb7b6ce2b
3 changed files with 3 additions and 3 deletions

View File

@ -3196,7 +3196,7 @@ class ConfigOpts(abc.Mapping):
except ValueError:
sys.stderr.write("argument --%s: Invalid %s value: %s\n" % (
opt.dest, repr(opt.type), value))
raise SystemExit
raise SystemExit(1)
def _reload_config_files(self):
namespace = self._parse_config_files()

View File

@ -826,7 +826,7 @@ def main(args=None):
except cfg.RequiredOptError:
conf.print_help()
if not sys.argv[1:]:
raise SystemExit
raise SystemExit(1)
raise
generate(conf)

View File

@ -227,7 +227,7 @@ def main():
except cfg.RequiredOptError:
conf.print_help()
if not sys.argv[1:]:
raise SystemExit
raise SystemExit(1)
raise
return _validate(conf)