summaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorValeriyaSinevich <valeriya.sinevich@phystech.edu>2018-07-19 15:34:03 -0700
committerSteve Dower <steve.dower@microsoft.com>2018-07-19 15:34:03 -0700
commitce75df3031c86b78311b1ad76c39c0b39d7d7424 (patch)
treef1bd2a5e30885b6f45c0df239d6063e30aa2eb9c /Parser
parent81950495ba2c36056e0ce48fd37d514816c26747 (diff)
downloadcpython-git-ce75df3031c86b78311b1ad76c39c0b39d7d7424.tar.gz
bpo-30237: Output error when ReadConsole is canceled by CancelSynchronousIo. (GH-7911)
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();