From 710ddde8905f8440be742562f505e84d814a15fe Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Tue, 21 Nov 2023 10:37:16 +0500 Subject: [PATCH] fix: support older versions of colorama --- copier/tools.py | 7 ++++++- pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/copier/tools.py b/copier/tools.py index 4e7364696..f8ac6724b 100644 --- a/copier/tools.py +++ b/copier/tools.py @@ -19,7 +19,12 @@ from .types import IntSeq -colorama.just_fix_windows_console() +try: + colorama_init = colorama.just_fix_windows_console +except AttributeError: # pragma: no cover + colorama_init = colorama.init + +colorama_init() class Style: diff --git a/pyproject.toml b/pyproject.toml index 3ea3ea7f7..2b2c6fa30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ copier = "copier.__main__:copier_app_run" [tool.poetry.dependencies] python = ">=3.8,<4.0" # HACK https://github.com/PyCQA/isort/issues/1945 -colorama = ">=0.4.6" +colorama = ">=0.4.3" decorator = ">=5.1.1" dunamai = ">=1.7.0" funcy = ">=1.17"