Skip to content

Commit 8a41c91

Browse files
authored
Update formatting_windows.py (#477)
Add a check if 'isatty' member exists in the object, required for packaging with PyInstaller.
1 parent ffb8121 commit 8a41c91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fire/formatting_windows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def initialize_or_disable():
3535
"""Enables ANSI processing on Windows or disables it as needed."""
3636
if HAS_COLORAMA:
3737
wrap = True
38-
if sys.stdout.isatty() and platform.release() == '10':
38+
if hasattr(sys.stdout, "isatty") and sys.stdout.isatty() and platform.release() == '10':
3939
# Enables native ANSI sequences in console.
4040
# Windows 10, 2016, and 2019 only.
4141

0 commit comments

Comments
 (0)