Skip to content

Commit 619dc28

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

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Lib/test/test_tarfile.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -694,11 +694,10 @@ 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+
os.mkdir(DIR)
700+
try:
702701
directories = [t for t in tar if t.isdir()]
703702
tar.extractall(DIR, directories, filter='fully_trusted')
704703
for tarinfo in directories:
@@ -719,6 +718,9 @@ def format_mtime(mtime):
719718
format_mtime(file_mtime),
720719
path)
721720
self.assertEqual(tarinfo.mtime, file_mtime, errmsg)
721+
finally:
722+
tar.close()
723+
os_helper.rmtree(DIR)
722724

723725
@staticmethod
724726
def test_extractall_default_filter():

0 commit comments

Comments
 (0)