summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_shutil.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-11-21 12:11:57 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-11-21 12:11:57 (GMT)
commit1a31cba4642a5907a4af1f739791067988433f5e (patch)
tree52d23a91bafba6fc6e06e810440f97607bdd8ba4 /Lib/test/test_shutil.py
parent76ced9972184645790fba038e2de4811d7d468ba (diff)
downloadcpython-1a31cba4642a5907a4af1f739791067988433f5e.zip
cpython-1a31cba4642a5907a4af1f739791067988433f5e.tar.gz
cpython-1a31cba4642a5907a4af1f739791067988433f5e.tar.bz2
Issue #25686: test_shutil no longer uses the distutils package for running
external archivers.
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r--Lib/test/test_shutil.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index f5adf99..71317b3 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -8,8 +8,8 @@ import stat
import os
import os.path
import errno
-from os.path import splitdrive
-from distutils.spawn import find_executable, spawn
+import subprocess
+from distutils.spawn import find_executable
from shutil import (make_archive,
register_archive_format, unregister_archive_format,
get_archive_formats)
@@ -443,8 +443,7 @@ class TestShutil(unittest.TestCase):
# now create another tarball using `tar`
tarball2 = os.path.join(root_dir, 'archive2.tar')
tar_cmd = ['tar', '-cf', 'archive2.tar', base_dir]
- with support.change_cwd(root_dir):
- spawn(tar_cmd)
+ subprocess.check_call(tar_cmd, cwd=root_dir)
self.assertTrue(os.path.isfile(tarball2))
# let's compare both tarballs
@@ -502,8 +501,7 @@ class TestShutil(unittest.TestCase):
# now create another ZIP file using `zip`
archive2 = os.path.join(root_dir, 'archive2.zip')
zip_cmd = ['zip', '-q', '-r', 'archive2.zip', base_dir]
- with support.change_cwd(root_dir):
- spawn(zip_cmd)
+ subprocess.check_call(zip_cmd, cwd=root_dir)
self.assertTrue(os.path.isfile(archive2))
# let's compare both ZIP files