mirror of
https://github.com/SELinuxProject/setools
synced 2025-02-19 13:37:04 +00:00
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:
parent
3ffc134f16
commit
ad72e87efb
4
apol
4
apol
@ -52,6 +52,10 @@ logging.getLogger().addHandler(console_handler)
|
|||||||
try:
|
try:
|
||||||
sys.exit(setoolsgui.run_apol(args.policy))
|
sys.exit(setoolsgui.run_apol(args.policy))
|
||||||
|
|
||||||
|
except AssertionError:
|
||||||
|
# Always provide a traceback for assertion errors
|
||||||
|
raise
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
if args.debug:
|
if args.debug:
|
||||||
raise
|
raise
|
||||||
|
@ -59,6 +59,10 @@ except setools.exception.InvalidCheckerConfig as err:
|
|||||||
|
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
|
except AssertionError:
|
||||||
|
# Always provide a traceback for assertion errors
|
||||||
|
raise
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
if args.debug:
|
if args.debug:
|
||||||
raise
|
raise
|
||||||
|
4
sediff
4
sediff
@ -1498,6 +1498,10 @@ try:
|
|||||||
del diff.added_typebounds
|
del diff.added_typebounds
|
||||||
del diff.removed_typebounds
|
del diff.removed_typebounds
|
||||||
|
|
||||||
|
except AssertionError:
|
||||||
|
# Always provide a traceback for assertion errors
|
||||||
|
raise
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
if args.debug:
|
if args.debug:
|
||||||
raise
|
raise
|
||||||
|
4
sedta
4
sedta
@ -121,6 +121,10 @@ try:
|
|||||||
print("\nGraph statistics:")
|
print("\nGraph statistics:")
|
||||||
print(g.get_stats())
|
print(g.get_stats())
|
||||||
|
|
||||||
|
except AssertionError:
|
||||||
|
# Always provide a traceback for assertion errors
|
||||||
|
raise
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
if args.debug:
|
if args.debug:
|
||||||
raise
|
raise
|
||||||
|
4
seinfo
4
seinfo
@ -395,6 +395,10 @@ try:
|
|||||||
strfmt = " {0}" if not args.flat else "{0}"
|
strfmt = " {0}" if not args.flat else "{0}"
|
||||||
print(strfmt.format(result))
|
print(strfmt.format(result))
|
||||||
|
|
||||||
|
except AssertionError:
|
||||||
|
# Always provide a traceback for assertion errors
|
||||||
|
raise
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
if args.debug:
|
if args.debug:
|
||||||
raise
|
raise
|
||||||
|
@ -153,6 +153,10 @@ try:
|
|||||||
print("\nGraph statistics:")
|
print("\nGraph statistics:")
|
||||||
print(g.get_stats())
|
print(g.get_stats())
|
||||||
|
|
||||||
|
except AssertionError:
|
||||||
|
# Always provide a traceback for assertion errors
|
||||||
|
raise
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
if args.debug:
|
if args.debug:
|
||||||
raise
|
raise
|
||||||
|
4
sesearch
4
sesearch
@ -239,6 +239,10 @@ try:
|
|||||||
for mls_result in sorted(mlsrq.results()):
|
for mls_result in sorted(mlsrq.results()):
|
||||||
print(mls_result)
|
print(mls_result)
|
||||||
|
|
||||||
|
except AssertionError:
|
||||||
|
# Always provide a traceback for assertion errors
|
||||||
|
raise
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
if args.debug:
|
if args.debug:
|
||||||
raise
|
raise
|
||||||
|
Loading…
Reference in New Issue
Block a user