diff options
author | ValeriyaSinevich <valeriya.sinevich@phystech.edu> | 2018-07-19 22:34:03 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2018-07-19 22:34:03 (GMT) |
commit | ce75df3031c86b78311b1ad76c39c0b39d7d7424 (patch) | |
tree | f1bd2a5e30885b6f45c0df239d6063e30aa2eb9c /Parser | |
parent | 81950495ba2c36056e0ce48fd37d514816c26747 (diff) | |
download | cpython-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.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(); |