From 0e48776fb24a721ddb358bf8b8f242232f3b6e5d Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Wed, 30 Nov 2022 17:08:46 +0700 Subject: [PATCH] superfluous code --- rich/console.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/rich/console.py b/rich/console.py index 05e95da9..c59f0d77 100644 --- a/rich/console.py +++ b/rich/console.py @@ -2008,15 +2008,9 @@ class Console: if self.legacy_windows: fileno = get_fileno(self.file) if fileno is not None: - try: - use_legacy_windows_render = ( - fileno in _STD_STREAMS_OUTPUT - ) - except Exception: - # `fileno` is documented as potentially raising a OSError - # Alas, from the issues, there are so many poorly implemented file-like objects, - # that `fileno()` can raise just about anything. - pass + use_legacy_windows_render = ( + fileno in _STD_STREAMS_OUTPUT + ) if use_legacy_windows_render: from rich._win32_console import LegacyWindowsTerm