[Python-checkins] r73182 - python/trunk/Lib/asyncore.py

josiah.carlson python-checkins at python.org
Wed Jun 3 21:46:21 CEST 2009


Author: josiah.carlson
Date: Wed Jun 3 21:46:21 2009
New Revision: 73182
Log:
This fixes bug 5798 on OS X.
This should also fix disconnect behavior cross-platform.
Modified:
 python/trunk/Lib/asyncore.py
Modified: python/trunk/Lib/asyncore.py
==============================================================================
--- python/trunk/Lib/asyncore.py	(original)
+++ python/trunk/Lib/asyncore.py	Wed Jun 3 21:46:21 2009
@@ -101,10 +101,16 @@
 obj.handle_read_event()
 if flags & select.POLLOUT:
 obj.handle_write_event()
- if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
- obj.handle_close()
 if flags & select.POLLPRI:
 obj.handle_expt_event()
+ if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
+ obj.handle_close()
+ except socket.error, e:
+ if e.args[0] not in (EBADF, ECONNRESET, ENOTCONN, ESHUTDOWN,
+ECONNABORTED):
+ obj.handle_error()
+ else:
+ obj.handle_close()
 except _reraised_exceptions:
 raise
 except:


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /