summaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-07-29 02:32:02 -0700
committerSteve Dower <steve.dower@microsoft.com>2018-07-29 10:32:02 +0100
commitc3af73d580888b4d444264e79dce6ec0818522cd (patch)
treeace20ca3a4db511cb5838e629218c0a1d014327f /Parser
parent1e98d87961ec752a1623135f4d7e8a41820ae256 (diff)
downloadcpython-git-c3af73d580888b4d444264e79dce6ec0818522cd.tar.gz
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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index 2aa3bef2b0..edb291a669 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();