summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests/support.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-07-03 09:12:27 (GMT)
committerGitHub <noreply@github.com>2019-07-03 09:12:27 (GMT)
commit74c9dd57771f4f061ee83b069c8e7b37de41246b (patch)
tree242a627f7b7bf36fd594c7f10b546b0a1f8de51a /Lib/distutils/tests/support.py
parent684cb47fffb7af3ac50cb077f6d2a095c9ce20b4 (diff)
downloadcpython-74c9dd57771f4f061ee83b069c8e7b37de41246b.zip
cpython-74c9dd57771f4f061ee83b069c8e7b37de41246b.tar.gz
cpython-74c9dd57771f4f061ee83b069c8e7b37de41246b.tar.bz2
bpo-37421: Fix test_distutils.test_build_ext() (GH-14564)
test_distutils.test_build_ext() is now able to remove the temporary directory on Windows: don't import the newly built C extension ("xx") in the current process, but test it in a separated process.
Diffstat (limited to 'Lib/distutils/tests/support.py')
-rw-r--r--Lib/distutils/tests/support.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/distutils/tests/support.py b/Lib/distutils/tests/support.py
index 7385c6b..0413098 100644
--- a/Lib/distutils/tests/support.py
+++ b/Lib/distutils/tests/support.py
@@ -6,6 +6,7 @@ import tempfile
import unittest
import sysconfig
from copy import deepcopy
+import test.support
from distutils import log
from distutils.log import DEBUG, INFO, WARN, ERROR, FATAL
@@ -64,8 +65,8 @@ class TempdirManager(object):
os.chdir(self.old_cwd)
super().tearDown()
while self.tempdirs:
- d = self.tempdirs.pop()
- shutil.rmtree(d, os.name in ('nt', 'cygwin'))
+ tmpdir = self.tempdirs.pop()
+ test.support.rmtree(tmpdir)
def mkdtemp(self):
"""Create a temporary directory that will be cleaned up.