Skip to content

Commit c3638d4

Browse files
committed
revert style changes for unrelated tests
1 parent 57c60e7 commit c3638d4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Lib/test/test_tarfile.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -694,11 +694,9 @@ def test_extract_hardlink(self):
694694
def test_extractall(self):
695695
# Test if extractall() correctly restores directory permissions
696696
# and times (see issue1735).
697-
DIR = pathlib.Path(TEMPDIR) / "extractall"
698-
with (
699-
os_helper.temp_dir(DIR),
700-
tarfile.open(tarname, encoding="iso8859-1") as tar
701-
):
697+
tar = tarfile.open(tarname, encoding="iso8859-1")
698+
DIR = os.path.join(TEMPDIR, "extractall")
699+
try:
702700
directories = [t for t in tar if t.isdir()]
703701
tar.extractall(DIR, directories, filter='fully_trusted')
704702
for tarinfo in directories:
@@ -719,6 +717,9 @@ def format_mtime(mtime):
719717
format_mtime(file_mtime),
720718
path)
721719
self.assertEqual(tarinfo.mtime, file_mtime, errmsg)
720+
finally:
721+
tar.close()
722+
os_helper.rmtree(DIR)
722723

723724
@staticmethod
724725
def test_extractall_default_filter():

0 commit comments

Comments
 (0)