From 644ad74ea1a33ef7112da1537e83c802b2b15202 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 24 Dec 2017 13:49:58 -0500 Subject: preprocess_frozen_modules.py: make compatible with Python 3.4. --- tools/preprocess_frozen_modules.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/preprocess_frozen_modules.py b/tools/preprocess_frozen_modules.py index e29b54b16..b425ffa2d 100755 --- a/tools/preprocess_frozen_modules.py +++ b/tools/preprocess_frozen_modules.py @@ -45,7 +45,9 @@ def copy_and_process(in_dir, out_dir): output_file_path = Path(out_dir, input_file_path.relative_to(in_dir)) if file.endswith(".py"): - output_file_path.parent.mkdir(parents=True, exist_ok=True) + # mkdir() takes an exists_ok=True, but not until Python 3.5. + if not output_file_path.parent.exists(): + output_file_path.parent.mkdir(parents=True) with input_file_path.open("r") as input, output_file_path.open("w") as output: for line in input: if line.startswith("__version__"): -- cgit v1.2.3