diff options
author | Chris Liechti <cliechti@gmx.net> | 2016-05-12 23:48:01 +0200 |
---|---|---|
committer | Chris Liechti <cliechti@gmx.net> | 2016-05-12 23:48:01 +0200 |
commit | c0d6a0f88a800c54c908ec4e94af2a332384e90b (patch) | |
tree | c6dadfe8734031b7fcefd968a74b403a4031ab7f /serial/serialwin32.py | |
parent | f41b45939754689e5414d0e319664f2b19cb1559 (diff) | |
download | pyserial-git-c0d6a0f88a800c54c908ec4e94af2a332384e90b.tar.gz |
win32: fix error code checking in _cancel_overlapped_io
it may also report ERROR_IO_INCOMPLETE when io is in progress
Diffstat (limited to 'serial/serialwin32.py')
-rw-r--r-- | serial/serialwin32.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/serial/serialwin32.py b/serial/serialwin32.py index b843ac7..d11a2c4 100644 --- a/serial/serialwin32.py +++ b/serial/serialwin32.py @@ -437,7 +437,7 @@ class Serial(SerialBase): ctypes.byref(overlapped), ctypes.byref(rc), False) - if not err and win32.GetLastError() == win32.ERROR_IO_PENDING: + if not err and win32.GetLastError() in (win32.ERROR_IO_PENDING, win32.ERROR_IO_INCOMPLETE): # cancel, ignoring any errors (e.g. it may just have finished on its own) win32.CancelIoEx(self._port_handle, overlapped) |