A more accurate termcolor.colored fallback (#9435)

This commit is contained in:
Avasam
2022-12-31 17:52:26 -05:00
committed by GitHub
parent f794cdd582
commit 46f0d918ef
2 changed files with 11 additions and 10 deletions

View File

@@ -7,12 +7,13 @@ import re
import subprocess
import sys
from pathlib import Path
from typing import Iterable
try:
from termcolor import colored
except ImportError:
def colored(text: str, color: str = "") -> str: # type: ignore[misc]
def colored(text: str, color: str | None = None, on_color: str | None = None, attrs: Iterable[str] | None = None) -> str:
return text