def make_dirs(file_path):
"""Make the directories for a file path
:param file_path: file path to be created if it doesn't exist
:type file_path: str
:return: None
"""
try:
os.makedirs(os.path.dirname(file_path))
except OSError as exc: # Guard against race condition
if exc.errno != errno.EEXIST:
raise # pragma: no cover
评论列表
文章目录