Skip to content

Commit 0092b0a

Browse files
author
Brant Watson
committed
Honor NO_COLOR environment variable.
1 parent c7707ce commit 0092b0a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/log_color/colors.py

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ def color_supported(force_seq=None):
5151
if force_seq is False or force_seq is True:
5252
return force_seq
5353

54+
# Honor NO_COLOR environment variable:
55+
if os.environ.get('NO_COLOR', None):
56+
return False
57+
5458
# Attempt simple autodetection
5559
if (
5660
(hasattr(sys.stderr, "isatty") and sys.stderr.isatty()) or

0 commit comments

Comments
 (0)