diff options
author | Ćukasz Langa <lukasz@langa.pl> | 2025-05-05 21:45:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-05 21:45:25 (GMT) |
commit | f610bbdf74ea580b14353c6bfd08fd00bcbfa11e (patch) | |
tree | 5755794c7c8f2e4c14ad4be9665499311b4db17b /Lib/asyncio/__main__.py | |
parent | 9cc77aaf9dce6ffa82786dc77f7f83387c857cad (diff) | |
download | cpython-f610bbdf74ea580b14353c6bfd08fd00bcbfa11e.zip cpython-f610bbdf74ea580b14353c6bfd08fd00bcbfa11e.tar.gz cpython-f610bbdf74ea580b14353c6bfd08fd00bcbfa11e.tar.bz2 |
gh-133346: Make theming support in _colorize extensible (GH-133347)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Diffstat (limited to 'Lib/asyncio/__main__.py')
-rw-r--r-- | Lib/asyncio/__main__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/asyncio/__main__.py b/Lib/asyncio/__main__.py index 7d980bc..d85a326 100644 --- a/Lib/asyncio/__main__.py +++ b/Lib/asyncio/__main__.py @@ -12,7 +12,7 @@ import threading import types import warnings -from _colorize import can_colorize, ANSIColors # type: ignore[import-not-found] +from _colorize import get_theme from _pyrepl.console import InteractiveColoredConsole from . import futures @@ -103,8 +103,9 @@ class REPLThread(threading.Thread): exec(startup_code, console.locals) ps1 = getattr(sys, "ps1", ">>> ") - if can_colorize() and CAN_USE_PYREPL: - ps1 = f"{ANSIColors.BOLD_MAGENTA}{ps1}{ANSIColors.RESET}" + if CAN_USE_PYREPL: + theme = get_theme().syntax + ps1 = f"{theme.prompt}{ps1}{theme.reset}" console.write(f"{ps1}import asyncio\n") if CAN_USE_PYREPL: |