Commit 448319a7 authored by Damien George's avatar Damien George

tools/makemanifest.py: Use os.makedirs to make path for generated files.

The existing implementation of mkdir() in this file is not sophisticated
enough to work correctly on all operating systems (eg Mac can raise
EISDIR).  Using the standard os.makedirs() function handles all cases
correctly.
Signed-off-by: default avatarDamien George <damien@micropython.org>
parent 492cf34f
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
# THE SOFTWARE. # THE SOFTWARE.
from __future__ import print_function from __future__ import print_function
import errno
import sys import sys
import os import os
import subprocess import subprocess
...@@ -165,17 +164,10 @@ def get_timestamp_newest(path): ...@@ -165,17 +164,10 @@ def get_timestamp_newest(path):
return ts_newest return ts_newest
def mkdir(path): def mkdir(filename):
cur_path = "" path = os.path.dirname(filename)
for p in path.split("/")[:-1]: if not os.path.isdir(path):
cur_path += p + "/" os.makedirs(path)
try:
os.mkdir(cur_path)
except OSError as er:
if er.args[0] == errno.EEXIST:
pass
else:
raise er
def freeze_internal(kind, path, script, opt): def freeze_internal(kind, path, script, opt):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment