georg.brandl
2008-07-20 07:31:31 UTC
Author: georg.brandl
Date: Sun Jul 20 09:31:30 2008
New Revision: 65153
Log:
Merged revisions 65152 via svnmerge from
svn+ssh://pythondev at 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.
........
Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Lib/asyncore.py
Modified: python/branches/py3k/Lib/asyncore.py
==============================================================================
--- python/branches/py3k/Lib/asyncore.py (original)
+++ python/branches/py3k/Lib/asyncore.py Sun Jul 20 09:31:30 2008
@@ -128,7 +128,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
try:
x.close()
except OSError as x:
- if x[0] == EBADF:
+ if x.args[0] == EBADF:
pass
elif not ignore_all:
raise
Date: Sun Jul 20 09:31:30 2008
New Revision: 65153
Log:
Merged revisions 65152 via svnmerge from
svn+ssh://pythondev at 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.
........
Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Lib/asyncore.py
Modified: python/branches/py3k/Lib/asyncore.py
==============================================================================
--- python/branches/py3k/Lib/asyncore.py (original)
+++ python/branches/py3k/Lib/asyncore.py Sun Jul 20 09:31:30 2008
@@ -128,7 +128,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
try:
x.close()
except OSError as x:
- if x[0] == EBADF:
+ if x.args[0] == EBADF:
pass
elif not ignore_all:
raise