8000 preprocess_frozen_modules.py: make compatible with Python 3.4. · ladyada/circuitpython@644ad74 · GitHub
[go: up one dir, main page]

Skip to content

Commit 644ad74

Browse files
committed
preprocess_frozen_modules.py: make compatible with Python 3.4.
1 parent 2dcb2f0 commit 644ad74

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/preprocess_frozen_modules.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ def copy_and_process(in_dir, out_dir):
4545
output_file_path = Path(out_dir, input_file_path.relative_to(in_dir))
4646

4747
if file.endswith(".py"):
48-
output_file_path.parent.mkdir(parents=True, exist_ok=True)
48+
# mkdir() takes an exists_ok=True, but not until Python 3.5.
49+
if not output_file_path.parent.exists():
50+
output_file_path.parent.mkdir(parents=True)
4951
with input_file_path.open("r") as input, output_file_path.open("w") as output:
5052
for line in input:
5153
if line.startswith("__version__"):

0 commit comments

Comments
 (0)
0