Merged revisions 83703 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/release27-maint

........
  r83703 | giampaolo.rodola | 2010-08-04 10:35:25 +0200 (mer, 04 ago 2010) | 1 line

  fix issue #2944: asyncore doesn't handle connection refused correctly (patch by Alexander Shigin)
........
This commit is contained in:
Giampaolo Rodolà 2010-08-04 08:58:38 +00:00
parent dba50788a7
commit 042cf1ae8c
3 changed files with 7 additions and 1 deletions

View file

@ -422,8 +422,11 @@ class dispatcher:
self.handle_read() self.handle_read()
def handle_connect_event(self): def handle_connect_event(self):
self.connected = True err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
if err != 0:
raise socket.error(err, _strerror(err))
self.handle_connect() self.handle_connect()
self.connected = True
def handle_write_event(self): def handle_write_event(self):
if self.accepting: if self.accepting:

View file

@ -817,3 +817,4 @@ Tarek Ziad
Peter Åstrand Peter Åstrand
Jesse Noller Jesse Noller
Fredrik Håård Fredrik Håård
Alexander Shigin

View file

@ -89,6 +89,8 @@ C-API
Library Library
------- -------
- Issue #2944: asyncore doesn't handle connection refused correctly.
- Issue #8447: Make distutils.sysconfig follow symlinks in the path to - Issue #8447: Make distutils.sysconfig follow symlinks in the path to
the interpreter executable. This fixes a failure of test_httpservers the interpreter executable. This fixes a failure of test_httpservers
on OS X. on OS X.