From b308e2b941031edef218a7c740afaec430989ac3 Mon Sep 17 00:00:00 2001 From: Paul O'Leary McCann Date: Thu, 16 Feb 2023 15:46:33 +0900 Subject: [PATCH] Remove tempdir changes These are now in a separate PR --- spacy/util.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spacy/util.py b/spacy/util.py index 3e4db141a..3956d27d7 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -1032,12 +1032,12 @@ def make_tempdir() -> Generator[Path, None, None]: YIELDS (Path): The path of the temp directory. """ - + d = Path(tempfile.mkdtemp()) + yield d try: - with tempfile.TemporaryDirectory() as td: - yield Path(td) + shutil.rmtree(str(d)) except PermissionError as e: - warnings.warn(Warnings.W091.format(dir=td, msg=e)) + warnings.warn(Warnings.W091.format(dir=d, msg=e)) def is_cwd(path: Union[Path, str]) -> bool: