diff --git a/get-poetry.py b/get-poetry.py index 0df27239a9b..c14c9d4d6ec 100644 --- a/get-poetry.py +++ b/get-poetry.py @@ -159,15 +159,15 @@ def colorize(style, text): def temporary_directory(*args, **kwargs): try: from tempfile import TemporaryDirectory - - with TemporaryDirectory(*args, **kwargs) as name: - yield name except ImportError: name = tempfile.mkdtemp(*args, **kwargs) yield name shutil.rmtree(name) + else: + with TemporaryDirectory(*args, **kwargs) as name: + yield name def string_to_bool(value):