From 71c721fa684592a5ec0ed38cc35c8e91a6c86ac6 Mon Sep 17 00:00:00 2001 From: eXcript Date: Fri, 29 Dec 2023 22:04:49 -0300 Subject: [PATCH] Update formatting_windows.py Add a check if 'isatty' member exists in the object, required for packaging with PyInstaller. --- fire/formatting_windows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fire/formatting_windows.py b/fire/formatting_windows.py index 2b85820d..4bcf82e0 100644 --- a/fire/formatting_windows.py +++ b/fire/formatting_windows.py @@ -35,7 +35,7 @@ def initialize_or_disable(): """Enables ANSI processing on Windows or disables it as needed.""" if HAS_COLORAMA: wrap = True - if sys.stdout.isatty() and platform.release() == '10': + if hasattr(sys.stdout, "isatty") and sys.stdout.isatty() and platform.release() == '10': # Enables native ANSI sequences in console. # Windows 10, 2016, and 2019 only.