From: Serhiy Storchaka Date: Sat, 21 Nov 2015 12:11:57 +0000 (+0200) Subject: Issue #25686: test_shutil no longer uses the distutils package for running X-Git-Tag: v2.7.11rc1~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1a31cba4642a5907a4af1f739791067988433f5e;p=python Issue #25686: test_shutil no longer uses the distutils package for running external archivers. --- diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index f5adf994f1..71317b39a5 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