Skip to content

Commit 9b9d58f

Browse files
tacaswellzooba
authored andcommitted
bpo-31546: Fix input hook integration (GH-7978)
1 parent 4d26c8a commit 9b9d58f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Restore running PyOS_InputHook while waiting for user input at the prompt.
2+
The restores integration of interactive GUI windows (such as Matplotlib
3+
figures) with the prompt on Windows.

Parser/myreadline.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ _PyOS_WindowsConsoleReadline(HANDLE hStdIn)
114114
wbuf = wbuf_local;
115115
wbuflen = sizeof(wbuf_local) / sizeof(wbuf_local[0]) - 1;
116116
while (1) {
117+
if (PyOS_InputHook != NULL) {
118+
(void)(PyOS_InputHook)();
119+
}
117120
if (!ReadConsoleW(hStdIn, &wbuf[total_read], wbuflen - total_read, &n_read, NULL)) {
118121
err = GetLastError();
119122
goto exit;

0 commit comments

Comments
 (0)