Skip to content

Commit c8f9f34

Browse files
committed
Fix review comments for GH-103931
1 parent 96fa029 commit c8f9f34

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix repeated calls to :c:var:`PyOS_InputHook` for long input lines.

Parser/myreadline.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,12 +306,12 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt)
306306
fprintf(stderr, "%s", prompt);
307307
}
308308
fflush(stderr);
309-
309+
// Keep this outside my_fgets(): long lines call my_fgets() repeatedly.
310310
if (PyOS_InputHook != NULL &&
311311
// GH-104668: See PyOS_ReadlineFunctionPointer's comment below...
312312
_Py_IsMainInterpreter(tstate->interp))
313313
{
314-
(void)(PyOS_InputHook)();
314+
(void)(PyOS_InputHook)();
315315
}
316316

317317
n = 0;

0 commit comments

Comments
 (0)