summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorValeriyaSinevich <valeriya.sinevich@phystech.edu>2018-07-19 22:34:03 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2018-07-19 22:34:03 (GMT)
commitce75df3031c86b78311b1ad76c39c0b39d7d7424 (patch)
treef1bd2a5e30885b6f45c0df239d6063e30aa2eb9c /Parser
parent81950495ba2c36056e0ce48fd37d514816c26747 (diff)
downloadcpython-ce75df3031c86b78311b1ad76c39c0b39d7d7424.zip
cpython-ce75df3031c86b78311b1ad76c39c0b39d7d7424.tar.gz
cpython-ce75df3031c86b78311b1ad76c39c0b39d7d7424.tar.bz2
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 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();