X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2Fexception_handler.py;h=1dc3405c6c75414232ce34523d1c6d942c8c65a4;hb=885a328caa001ff223ac1e7f27bb6b6906228244;hp=ae3b82f5eee8c1970a06a134920d10b8b11176e8;hpb=d394bdd12408a16d6c322d2c9804ecd27c5d2998;p=bertos.git diff --git a/wizard/exception_handler.py b/wizard/exception_handler.py index ae3b82f5..1dc3405c 100644 --- a/wizard/exception_handler.py +++ b/wizard/exception_handler.py @@ -47,6 +47,8 @@ def _excepthook(exc_type, exc_value, exc_traceback): content = open(file_name, "r").read() else: content = "" + if not os.path.exists(os.path.dirname(file_name)): + os.makedirs(os.path.dirname(file_name)) f = open(file_name, "w") message = "\n".join(traceback.format_exception(exc_type, exc_value, exc_traceback)) f.write(message)