summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2017-12-24 13:49:58 -0500
committerDan Halbert <halbert@halwitz.org>2017-12-24 13:49:58 -0500
commit644ad74ea1a33ef7112da1537e83c802b2b15202 (patch)
tree42e5a35e960355d5c0bccaced8fb0b5735821e0c
parent2dcb2f06cbfaacb5cf362cac1ba547dd45d13e9a (diff)
preprocess_frozen_modules.py: make compatible with Python 3.4.
-rwxr-xr-xtools/preprocess_frozen_modules.py4
1 files changed, 3 insertions, 1 deletions
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__"):