]> granicus.if.org Git - python/commitdiff
bpo-31546: Fix input hook integration (GH-7978)
authorThomas A Caswell <tcaswell@gmail.com>
Thu, 28 Jun 2018 16:29:44 +0000 (12:29 -0400)
committerSteve Dower <steve.dower@microsoft.com>
Thu, 28 Jun 2018 16:29:44 +0000 (09:29 -0700)
Misc/NEWS.d/next/Windows/2018-06-27-23-33-54.bpo-31546.zJlap-.rst [new file with mode: 0644]
Parser/myreadline.c

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 (file)
index 0000000..8f48763
--- /dev/null
@@ -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.
index ab6bd4e83000aebfa6a675f611b965d99e335c50..2aa3bef2b0bbf6ede7b1e2dbf422db9fab39cde2 100644 (file)
@@ -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;