summaryrefslogtreecommitdiffstats
path: root/Lib/asyncore.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-01-06 18:23:30 (GMT)
committerGeorg Brandl <georg@python.org>2008-01-06 18:23:30 (GMT)
commit7357c23ee72d687433452555018e9931159a2dfa (patch)
treef0a2da44d6a4ae8e1314fbab26e88a17054ecfb3 /Lib/asyncore.py
parent74f36691db4c3a6f2bf5ebcfb14e936fef5becd1 (diff)
downloadcpython-7357c23ee72d687433452555018e9931159a2dfa.zip
cpython-7357c23ee72d687433452555018e9931159a2dfa.tar.gz
cpython-7357c23ee72d687433452555018e9931159a2dfa.tar.bz2
Fix exception slicing.
Diffstat (limited to 'Lib/asyncore.py')
-rw-r--r--Lib/asyncore.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index 3829c61..2ec2e0d 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -321,7 +321,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
@@ -331,7 +331,7 @@ 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
else:
raise
@@ -349,7 +349,7 @@ class dispatcher:
return data
except socket.error as why:
# winsock sometimes throws ENOTCONN
- if why[0] in [ECONNRESET, ENOTCONN, ESHUTDOWN]:
+ if why.args[0] in [ECONNRESET, ENOTCONN, ESHUTDOWN]:
self.handle_close()
return b''
else: