bpo-42427: Use the errno attribute of OSError instead of args[0] (GH-23449)

This commit is contained in:
Serhiy Storchaka 2020-11-22 10:28:34 +02:00 committed by GitHub
parent bd8c22e1fa
commit c4d45ee670
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View file

@ -706,7 +706,7 @@ class SocketIO(io.RawIOBase):
self._timeout_occurred = True
raise
except error as e:
if e.args[0] in _blocking_errnos:
if e.errno in _blocking_errnos:
return None
raise
@ -722,7 +722,7 @@ class SocketIO(io.RawIOBase):
return self._sock.send(b)
except error as e:
# XXX what about EINTR?
if e.args[0] in _blocking_errnos:
if e.errno in _blocking_errnos:
return None
raise