Skip to content
Snippets Groups Projects
Commit 55db12e5 authored by Brodie Rao's avatar Brodie Rao
Browse files

color: fix TypeError with auto mode on win32 when colors aren't available (issue2871)

This can happen when stdout isn't a terminal (e.g., it's being piped).
parent aab323df
No related branches found
No related tags found
No related merge requests found
......@@ -174,9 +174,10 @@
realmode = 'terminfo'
if realmode == 'win32':
if not w32effects and mode == 'win32':
# only warn if color.mode is explicitly set to win32
ui.warn(_('warning: failed to set color mode to %s\n') % mode)
if not w32effects:
if mode == 'win32':
# only warn if color.mode is explicitly set to win32
ui.warn(_('warning: failed to set color mode to %s\n') % mode)
return None
_effects.update(w32effects)
elif realmode == 'ansi':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment