!467 Fix bug: Using safe way to create directory in Python code

Merge pull request !467 from candanzg/bug_for_makedirs
This commit is contained in:
mindspore-ci-bot 2020-04-21 09:12:59 +08:00 committed by Gitee
commit 717ed427b2
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ def _make_directory(path: str):
# All exceptions need to be caught because create directory maybe have some limit(permissions)
logger.debug("The directory(%s) doesn't exist, will create it", path)
try:
os.makedirs(path)
os.makedirs(path, exist_ok=True)
real_path = path
except PermissionError as e:
logger.error("No write permission on the directory(%r), error = %r", path, e)