Skip to content

Commit

Permalink
sys.flags.ignore_environment means ignore only PYTHON* env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Dec 12, 2024
1 parent b067996 commit 2991740
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Lib/_colorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@ def can_colorize() -> bool:
return False
if not COLORIZE:
return False
if not sys.flags.ignore_environment:
if "FORCE_COLOR" in os.environ:
return True
if os.environ.get("TERM") == "dumb":
return False
if "FORCE_COLOR" in os.environ:
return True
if os.environ.get("TERM") == "dumb":
return False

if not hasattr(sys.stderr, "fileno"):
return False
Expand Down

0 comments on commit 2991740

Please sign in to comment.