diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-07-29 09:32:02 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2018-07-29 09:32:02 (GMT) |
commit | c3af73d580888b4d444264e79dce6ec0818522cd (patch) | |
tree | ace20ca3a4db511cb5838e629218c0a1d014327f /Parser | |
parent | 1e98d87961ec752a1623135f4d7e8a41820ae256 (diff) | |
download | cpython-c3af73d580888b4d444264e79dce6ec0818522cd.zip cpython-c3af73d580888b4d444264e79dce6ec0818522cd.tar.gz cpython-c3af73d580888b4d444264e79dce6ec0818522cd.tar.bz2 |
bpo-30237: Output error when ReadConsole is canceled by CancelSynchronousIo. (GH-7911)
(cherry picked from commit ce75df3031c86b78311b1ad76c39c0b39d7d7424)
Co-authored-by: ValeriyaSinevich <valeriya.sinevich@phystech.edu>
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/myreadline.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Parser/myreadline.c b/Parser/myreadline.c index 2aa3bef..edb291a 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -109,7 +109,7 @@ _PyOS_WindowsConsoleReadline(HANDLE hStdIn) char *buf = NULL; int err = 0; - n_read = 0; + n_read = (DWORD)-1; total_read = 0; wbuf = wbuf_local; wbuflen = sizeof(wbuf_local) / sizeof(wbuf_local[0]) - 1; @@ -121,6 +121,9 @@ _PyOS_WindowsConsoleReadline(HANDLE hStdIn) err = GetLastError(); goto exit; } + if (n_read == (DWORD)-1 && (err = GetLastError()) == ERROR_OPERATION_ABORTED) { + break; + } if (n_read == 0) { int s; err = GetLastError(); |