summaryrefslogtreecommitdiff
path: root/setuptools/tests
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-07-13 14:13:54 -0400
committerJason R. Coombs <jaraco@jaraco.com>2017-07-13 14:13:54 -0400
commit04a306fa080e8a71f94ea5198b507c501c621cb6 (patch)
treee8cf48586c26f719302136397697ddebdbf2e9af /setuptools/tests
parent902edffbbab6203a9b3d765485159208fa6e68c3 (diff)
downloadpython-setuptools-git-04a306fa080e8a71f94ea5198b507c501c621cb6.tar.gz
Use makedirs with future compatibility throughout setuptools. Ref #1083.
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/files.py6
-rw-r--r--setuptools/tests/test_manifest.py4
2 files changed, 6 insertions, 4 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:
diff --git a/setuptools/tests/test_manifest.py b/setuptools/tests/test_manifest.py
index ab9b3469..65eec7d9 100644
--- a/setuptools/tests/test_manifest.py
+++ b/setuptools/tests/test_manifest.py
@@ -10,6 +10,7 @@ import itertools
from distutils import log
from distutils.errors import DistutilsTemplateError
+import pkg_resources.py31compat
from setuptools.command.egg_info import FileList, egg_info, translate_pattern
from setuptools.dist import Distribution
from setuptools.extern import six
@@ -361,8 +362,7 @@ class TestFileListTest(TempDirTestCase):
for file in files:
file = os.path.join(self.temp_dir, file)
dirname, basename = os.path.split(file)
- if not os.path.exists(dirname):
- os.makedirs(dirname)
+ pkg_resources.py31compat.makedirs(dirname, exist_ok=True)
open(file, 'w').close()
def test_process_template_line(self):