From a9245148d165fb1590eaebfa4174b7849434d273 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Tue, 1 Mar 2022 10:03:54 +0000 Subject: [PATCH] Ensure legacy Windows imports only happen on legacy Windows --- rich/console.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rich/console.py b/rich/console.py index 576813de63..b29c90aefc 100644 --- a/rich/console.py +++ b/rich/console.py @@ -31,8 +31,6 @@ cast, ) -from rich._win32_console import LegacyWindowsTerm - if sys.version_info >= (3, 8): from typing import Literal, Protocol, runtime_checkable else: @@ -1913,6 +1911,7 @@ def _check_buffer(self) -> None: else: if WINDOWS: if self.legacy_windows: + from rich._win32_console import LegacyWindowsTerm from rich._windows_renderer import legacy_windows_render legacy_windows_render(