Skip to content

Commit

Permalink
Disable colorama on Linux (fixes pypa#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
abitrolly committed Jun 30, 2022
1 parent 4edd5ef commit 691f063
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/build/__main__.py
Expand Up @@ -4,6 +4,7 @@
import argparse
import contextlib
import os
import platform
import shutil
import subprocess
import sys
Expand Down Expand Up @@ -60,12 +61,13 @@ def _showwarning(
def _setup_cli() -> None:
warnings.showwarning = _showwarning

try:
import colorama
except ModuleNotFoundError:
pass
else:
colorama.init() # fix colors on windows
if platform.system() == 'Windows':
# try to enable colors
try:
import colorama
colorama.init()
except ModuleNotFoundError:
pass


def _error(msg: str, code: int = 1) -> NoReturn: # pragma: no cover
Expand Down

0 comments on commit 691f063

Please sign in to comment.