From 8c966df105daf496c35642ba26c2bb55a870afdf Mon Sep 17 00:00:00 2001 From: Ali Parlakci Date: Sat, 21 Jul 2018 21:50:54 +0300 Subject: [PATCH] Improved traceback --- script.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/script.py b/script.py index 345606f..5ef5a45 100644 --- a/script.py +++ b/script.py @@ -668,7 +668,10 @@ if __name__ == "__main__": GLOBAL.directory = Path(".\\") print("\nQUITTING...") except Exception as exception: - logging.error("Runtime error!", exc_info=full_exc_info(sys.exc_info())) + if GLOBAL.directory is None: + GLOBAL.directory = Path(".\\") + logging.error(sys.exc_info()[0].__name__, + exc_info=full_exc_info(sys.exc_info())) print(log_stream.getvalue()) input("Press enter to quit\n")