diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2017-07-13 14:13:54 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-07-13 14:13:54 -0400 |
commit | 04a306fa080e8a71f94ea5198b507c501c621cb6 (patch) | |
tree | e8cf48586c26f719302136397697ddebdbf2e9af /setuptools/tests/files.py | |
parent | 902edffbbab6203a9b3d765485159208fa6e68c3 (diff) | |
download | python-setuptools-git-04a306fa080e8a71f94ea5198b507c501c621cb6.tar.gz |
Use makedirs with future compatibility throughout setuptools. Ref #1083.
Diffstat (limited to 'setuptools/tests/files.py')
-rw-r--r-- | setuptools/tests/files.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/setuptools/tests/files.py b/setuptools/tests/files.py index 4364241b..98de9fc3 100644 --- a/setuptools/tests/files.py +++ b/setuptools/tests/files.py @@ -1,6 +1,9 @@ import os +import pkg_resources.py31compat + + def build_files(file_defs, prefix=""): """ Build a set of files/directories, as described by the file_defs dictionary. @@ -24,8 +27,7 @@ def build_files(file_defs, prefix=""): for name, contents in file_defs.items(): full_name = os.path.join(prefix, name) if isinstance(contents, dict): - if not os.path.exists(full_name): - os.makedirs(full_name) + pkg_resources.py31compat.makedirs(full_name, exist_ok=True) build_files(contents, prefix=full_name) else: with open(full_name, 'w') as f: |