Skip to content

Commit

Permalink
Update formatting_windows.py (#477)
Browse files Browse the repository at this point in the history
Add a check if 'isatty' member exists in the object, required for packaging with PyInstaller.
  • Loading branch information
excript committed Jan 9, 2024
1 parent ffb8121 commit 8a41c91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fire/formatting_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 8a41c91

Please sign in to comment.