gh-140251: colorize import statement formatting in asyncio console (#140252)

This commit is contained in:
Frost Ming 2025-10-18 22:35:24 +08:00 committed by GitHub
parent 58c44c2bf2
commit d86ad870cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -107,7 +107,10 @@ def run(self):
if CAN_USE_PYREPL: if CAN_USE_PYREPL:
theme = get_theme().syntax theme = get_theme().syntax
ps1 = f"{theme.prompt}{ps1}{theme.reset}" ps1 = f"{theme.prompt}{ps1}{theme.reset}"
console.write(f"{ps1}import asyncio\n") import_line = f'{theme.keyword}import{theme.reset} asyncio'
else:
import_line = "import asyncio"
console.write(f"{ps1}{import_line}\n")
if CAN_USE_PYREPL: if CAN_USE_PYREPL:
from _pyrepl.simple_interact import ( from _pyrepl.simple_interact import (

View file

@ -0,0 +1 @@
Colorize the default import statement ``import asyncio`` in asyncio REPL.