Skip to content

Commit

Permalink
fix isatty parameter behaviour xolox#84
Browse files Browse the repository at this point in the history
  • Loading branch information
heni committed Mar 20, 2020
1 parent 3935774 commit 2079c3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions coloredlogs/__init__.py
Expand Up @@ -424,13 +424,13 @@ def install(level=None, **kw):
# represent a logging level for system logging.
enable_system_logging(level=syslog_enabled)
# Figure out whether we can use ANSI escape sequences.
use_colors = kw.get('isatty', None)
if use_colors or use_colors is None:
use_colors = orig_use_colors = kw.get('isatty', None)
if use_colors or orig_use_colors is None:
# Try to enable Windows native ANSI support or Colorama.
if on_windows():
use_colors = enable_ansi_support()
# Disable ANSI escape sequences if 'stream' isn't connected to a terminal.
if use_colors or use_colors is None:
if orig_use_colors is None:
use_colors = terminal_supports_colors(stream)
# Create a stream handler.
handler = logging.StreamHandler(stream) if stream else StandardErrorHandler()
Expand Down

0 comments on commit 2079c3c

Please sign in to comment.