mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
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.
This commit is contained in:
parent
684cb47fff
commit
74c9dd5777
3 changed files with 36 additions and 23 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue