Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.14] gh-136924: Suspend REPL colorizing when in a REPL interactive command (GH-136926)#143390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ambv merged 1 commit intopython:3.14frommiss-islington:backport-2c39b9d-3.14
Jan 3, 2026
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletionsLib/_pyrepl/reader.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -619,6 +619,16 @@ def suspend(self) -> SimpleContextManager:
setattr(self,arg,prev_state[arg])
self.prepare()

@contextmanager
defsuspend_colorization(self)->SimpleContextManager:
try:
old_can_colorize=self.can_colorize
self.can_colorize=False
yield
finally:
self.can_colorize=old_can_colorize


deffinish(self)->None:
"""Called when a command signals that we're finished."""
pass
Expand Down
2 changes: 1 addition & 1 deletionLib/_pyrepl/simple_interact.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -125,7 +125,7 @@ def maybe_run_command(statement: str) -> bool:
command = REPL_COMMANDS[statement]
if callable(command):
# Make sure that history does not change because of commands
with reader.suspend_history():
with reader.suspend_history(), reader.suspend_colorization():
command()
return True
return False
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
The interactive help mode in the :term:`REPL` no longer incorrectly syntax
highlights text input as Python code. Contributed by Olga Matoula.
Loading

[8]ページ先頭

©2009-2026 Movatter.jp