ensure ERROR doesn't print an empty string

This commit is contained in:
Matt Martz 2019-02-19 17:17:25 -06:00
parent 6cf43b2ff7
commit f356c7b02d
1 changed files with 4 additions and 1 deletions

View File

@ -1915,7 +1915,10 @@ def main():
e = get_exception()
# Ignore a successful exit, or argparse exit
if getattr(e, 'code', 1) not in (0, 2):
raise SystemExit('ERROR: %s' % e)
msg = '%s' % e
if not msg:
msg = '%r' % e
raise SystemExit('ERROR: %s' % msg)
if __name__ == '__main__':