Skip to content

Commit b61114c

Browse files
committed
On UNIX-like systems don't fail because winerror is not available
1 parent 15d44ad commit b61114c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎Lib/asyncio/windows_events.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,8 @@ def finish_accept(trans, key, ov):
558558
except OSError as exc:
559559
# Fix bug when accepting a socket connection and ERROR_NETNAME_DELETED
560560
# occurs, leads this into a closing of the serving socket.
561-
if exc.winerror in (_overlapped.ERROR_NETNAME_DELETED,
561+
if hasattr(exc, 'winerror') and exc.winerror in (
562+
_overlapped.ERROR_NETNAME_DELETED,
562563
_overlapped.ERROR_OPERATION_ABORTED):
563564
conn.close()
564565
raise ConnectionResetError(*exc.args)

0 commit comments

Comments
 (0)