From: batt Date: Wed, 9 Sep 2009 14:37:43 +0000 (+0000) Subject: Create project dir if does not exist. X-Git-Tag: 2.2.0~56 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=885a328caa001ff223ac1e7f27bb6b6906228244;p=bertos.git Create project dir if does not exist. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2912 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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)