diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-06-28 17:47:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-28 17:47:54 (GMT) |
commit | 0ebd1bc94a941a5044e26de946c1100d652dfe46 (patch) | |
tree | da8ffa4fd7e481880f56bbedde9d7532532b9be4 | |
parent | ff41cc7dee7fb2ab2ac39915a7ec6eb8808e6a1c (diff) | |
download | cpython-0ebd1bc94a941a5044e26de946c1100d652dfe46.zip cpython-0ebd1bc94a941a5044e26de946c1100d652dfe46.tar.gz cpython-0ebd1bc94a941a5044e26de946c1100d652dfe46.tar.bz2 |
bpo-31546: Fix input hook integration (GH-7978)
(cherry picked from commit 9b9d58f0d88b338eb8d2ae0da5cd91d60d1b0e39)
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
-rw-r--r-- | Misc/NEWS.d/next/Windows/2018-06-27-23-33-54.bpo-31546.zJlap-.rst | 3 | ||||
-rw-r--r-- | Parser/myreadline.c | 3 |
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 0000000..8f48763 --- /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 9f3c2e3..bb02631 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -119,6 +119,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; |