From 4f844b6480809a808cf1a676deb72d7abf1e216f Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Mon, 14 Feb 2022 14:02:40 +0100 Subject: [PATCH] warn() has a flag to print exception stack traces now --- main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 3a59673..7481360 100644 --- a/main.py +++ b/main.py @@ -10,9 +10,12 @@ import sys, os, json, traceback EXIT_SUCCESS=0 EXIT_ERROR=1 -def warn(message): +def warn(message, is_exception=False): print("WARNING: "+str(message), file=sys.stderr) - traceback.print_stack() + if is_exception: + traceback.print_exc() + else: + traceback.print_stack() def error(message, is_exception=True, handle_gracefully=True): print("ERROR: "+str(message), file=sys.stderr)