Skip to content

Commit

Permalink
Disable colorama on Linux (fixes pypa#493)
Browse files Browse the repository at this point in the history
[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
  • Loading branch information
abitrolly authored and henryiii committed Oct 17, 2022
1 parent aaaf4f8 commit 6231afc
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 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,14 @@ 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 6231afc

Please sign in to comment.