File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -3200,7 +3200,8 @@ def _read_raw_input(
32003200 """Read input from either an interactive terminal session or a redirected stream."""
32013201 # _build_session() sets session.input to a DummyInput when not in a TTY.
32023202 if not isinstance (session .input , DummyInput ):
3203- return session .prompt (prompt , completer = completer , ** prompt_kwargs ) # type: ignore[arg-type]
3203+ with patch_stdout ():
3204+ return session .prompt (prompt , completer = completer , ** prompt_kwargs ) # type: ignore[arg-type]
32043205
32053206 # We're not at a terminal, so we're likely reading from a file or a pipe.
32063207 # We wait for a line of data before we print anything.
@@ -3311,13 +3312,12 @@ def get_prompt() -> ANSI | str:
33113312 if prompt == self .prompt :
33123313 prompt_to_use = get_prompt
33133314
3314- with patch_stdout ():
3315- return self ._read_raw_input (
3316- prompt = prompt_to_use ,
3317- session = self .session ,
3318- completer = self .completer ,
3319- pre_run = self .pre_prompt ,
3320- )
3315+ return self ._read_raw_input (
3316+ prompt = prompt_to_use ,
3317+ session = self .session ,
3318+ completer = self .completer ,
3319+ pre_run = self .pre_prompt ,
3320+ )
33213321 except EOFError :
33223322 return constants .EOF
33233323
You can’t perform that action at this time.
0 commit comments