mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Merged revisions 65152 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r65152 | georg.brandl | 2008-07-20 09:29:58 +0200 (Sun, 20 Jul 2008) | 2 lines Remove exception indexing in asyncore. ........
This commit is contained in:
parent
7af6eec6d0
commit
f112369463
1 changed files with 9 additions and 9 deletions
|
@ -128,7 +128,7 @@ def poll(timeout=0.0, map=None):
|
|||
try:
|
||||
r, w, e = select.select(r, w, e, timeout)
|
||||
except select.error as err:
|
||||
if err[0] != EINTR:
|
||||
if err.args[0] != EINTR:
|
||||
raise
|
||||
else:
|
||||
return
|
||||
|
@ -174,7 +174,7 @@ def poll2(timeout=0.0, map=None):
|
|||
try:
|
||||
r = pollster.poll(timeout)
|
||||
except select.error as err:
|
||||
if err[0] != EINTR:
|
||||
if err.args[0] != EINTR:
|
||||
raise
|
||||
r = []
|
||||
for fd, flags in r:
|
||||
|
@ -230,7 +230,7 @@ class dispatcher:
|
|||
try:
|
||||
self.addr = sock.getpeername()
|
||||
except socket.error as err:
|
||||
if err[0] == ENOTCONN:
|
||||
if err.args[0] == ENOTCONN:
|
||||
# To handle the case where we got an unconnected
|
||||
# socket.
|
||||
self.connected = False
|
||||
|
@ -338,7 +338,7 @@ class dispatcher:
|
|||
conn, addr = self.socket.accept()
|
||||
return conn, addr
|
||||
except socket.error as why:
|
||||
if why[0] == EWOULDBLOCK:
|
||||
if why.args[0] == EWOULDBLOCK:
|
||||
pass
|
||||
else:
|
||||
raise
|
||||
|
@ -348,9 +348,9 @@ class dispatcher:
|
|||
result = self.socket.send(data)
|
||||
return result
|
||||
except socket.error as why:
|
||||
if why[0] == EWOULDBLOCK:
|
||||
if why.args[0] == EWOULDBLOCK:
|
||||
return 0
|
||||
elif why[0] in (ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED):
|
||||
elif why.args[0] in (ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED):
|
||||
self.handle_close()
|
||||
return 0
|
||||
else:
|
||||
|
@ -368,7 +368,7 @@ class dispatcher:
|
|||
return data
|
||||
except socket.error as why:
|
||||
# winsock sometimes throws ENOTCONN
|
||||
if why[0] in [ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED]:
|
||||
if why.args[0] in [ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED]:
|
||||
self.handle_close()
|
||||
return b''
|
||||
else:
|
||||
|
@ -381,7 +381,7 @@ class dispatcher:
|
|||
try:
|
||||
self.socket.close()
|
||||
except socket.error as why:
|
||||
if why[0] not in (ENOTCONN, EBADF):
|
||||
if why.args[0] not in (ENOTCONN, EBADF):
|
||||
raise
|
||||
|
||||
# cheap inheritance, used to pass all other attribute
|
||||
|
@ -548,7 +548,7 @@ def close_all(map=None, ignore_all=False):
|
|||
try:
|
||||
x.close()
|
||||
except OSError as x:
|
||||
if x[0] == EBADF:
|
||||
if x.args[0] == EBADF:
|
||||
pass
|
||||
elif not ignore_all:
|
||||
raise
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue