From bdc7c22bcd09a4ef6418da56d59abb48f67c33a8 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 9 Oct 2022 22:16:33 +0100 Subject: [PATCH] Make handling of `FORCE_COLOR` environment variable match the emerging standard --- mypy/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mypy/util.py b/mypy/util.py index e836aefb3c7e..13ab3076b983 100644 --- a/mypy/util.py +++ b/mypy/util.py @@ -520,7 +520,9 @@ def parse_gray_color(cup: bytes) -> str: def should_force_color() -> bool: - return bool(int(os.getenv("MYPY_FORCE_COLOR", os.getenv("FORCE_COLOR", "0")))) + if "MYPY_FORCE_COLOR" in os.environ: + return bool(int(os.environ["MYPY_FORCE_COLOR"])) + return "FORCE_COLOR" in os.environ class FancyFormatter: