mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 03:41:28 +08:00
A more accurate termcolor.colored fallback (#9435)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user