summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas A Caswell <tcaswell@gmail.com>2018-06-28 12:29:44 -0400
committerSteve Dower <steve.dower@microsoft.com>2018-06-28 09:29:44 -0700
commit9b9d58f0d88b338eb8d2ae0da5cd91d60d1b0e39 (patch)
tree6a27c8270b49abf4552c5757b6c8627752a9a72e
parent4d26c8a177d8ada440b3cfdfb1d0423ab5ca81a7 (diff)
downloadcpython-git-9b9d58f0d88b338eb8d2ae0da5cd91d60d1b0e39.tar.gz
bpo-31546: Fix input hook integration (GH-7978)
-rw-r--r--Misc/NEWS.d/next/Windows/2018-06-27-23-33-54.bpo-31546.zJlap-.rst3
-rw-r--r--Parser/myreadline.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Windows/2018-06-27-23-33-54.bpo-31546.zJlap-.rst b/Misc/NEWS.d/next/Windows/2018-06-27-23-33-54.bpo-31546.zJlap-.rst
new file mode 100644
index 0000000000..8f487632ce
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2018-06-27-23-33-54.bpo-31546.zJlap-.rst
@@ -0,0 +1,3 @@
+Restore running PyOS_InputHook while waiting for user input at the prompt.
+The restores integration of interactive GUI windows (such as Matplotlib
+figures) with the prompt on Windows.
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index ab6bd4e830..2aa3bef2b0 100644
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -114,6 +114,9 @@ _PyOS_WindowsConsoleReadline(HANDLE hStdIn)
wbuf = wbuf_local;
wbuflen = sizeof(wbuf_local) / sizeof(wbuf_local[0]) - 1;
while (1) {
+ if (PyOS_InputHook != NULL) {
+ (void)(PyOS_InputHook)();
+ }
if (!ReadConsoleW(hStdIn, &wbuf[total_read], wbuflen - total_read, &n_read, NULL)) {
err = GetLastError();
goto exit;