CLI: Always show a traceback for AssertionErrors.

These are bugs and the traceback is needed for bug reports.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
This commit is contained in:
Chris PeBenito 2023-10-19 09:11:21 -04:00 committed by Chris PeBenito
parent 3ffc134f16
commit ad72e87efb
7 changed files with 28 additions and 0 deletions

4
apol
View File

@ -52,6 +52,10 @@ logging.getLogger().addHandler(console_handler)
try:
sys.exit(setoolsgui.run_apol(args.policy))
except AssertionError:
# Always provide a traceback for assertion errors
raise
except Exception as err:
if args.debug:
raise

View File

@ -59,6 +59,10 @@ except setools.exception.InvalidCheckerConfig as err:
sys.exit(2)
except AssertionError:
# Always provide a traceback for assertion errors
raise
except Exception as err:
if args.debug:
raise

4
sediff
View File

@ -1498,6 +1498,10 @@ try:
del diff.added_typebounds
del diff.removed_typebounds
except AssertionError:
# Always provide a traceback for assertion errors
raise
except Exception as err:
if args.debug:
raise

4
sedta
View File

@ -121,6 +121,10 @@ try:
print("\nGraph statistics:")
print(g.get_stats())
except AssertionError:
# Always provide a traceback for assertion errors
raise
except Exception as err:
if args.debug:
raise

4
seinfo
View File

@ -395,6 +395,10 @@ try:
strfmt = " {0}" if not args.flat else "{0}"
print(strfmt.format(result))
except AssertionError:
# Always provide a traceback for assertion errors
raise
except Exception as err:
if args.debug:
raise

View File

@ -153,6 +153,10 @@ try:
print("\nGraph statistics:")
print(g.get_stats())
except AssertionError:
# Always provide a traceback for assertion errors
raise
except Exception as err:
if args.debug:
raise

View File

@ -239,6 +239,10 @@ try:
for mls_result in sorted(mlsrq.results()):
print(mls_result)
except AssertionError:
# Always provide a traceback for assertion errors
raise
except Exception as err:
if args.debug:
raise