File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1818from contextlib import contextmanager
1919from functools import cache
2020from pathlib import Path
21- from tempfile import NamedTemporaryFile , TemporaryDirectory
21+ from tempfile import TemporaryDirectory
2222from typing import Any , NoReturn
2323from urllib .request import urlopen
2424from zipfile import ZipFile
@@ -619,8 +619,8 @@ def download_and_unpack_archive(
619619 # f"Failed to download cross-build environment from {url} (status code: {r.status_code})"
620620 # )
621621
622- with NamedTemporaryFile ( suffix = ".tar" ) as f :
623- f_path = Path (f . name )
622+ with TemporaryDirectory ( ) as temp_dir :
623+ f_path = Path (temp_dir ) / "temp.tar"
624624 f_path .write_bytes (data )
625625 with warnings .catch_warnings ():
626626 # Python 3.12-3.13 emits a DeprecationWarning when using shutil.unpack_archive without a filter,
You can’t perform that action at this time.
0 commit comments