diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2015-04-07 19:38:36 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2015-04-07 19:38:36 (GMT) |
| commit | 3c28878e401400c6a51edd84d6d550c42e9441b6 (patch) | |
| tree | 9a75e9bd7c6ead1e3ea069c0a21da18fe6cb530f /Lib/asyncio/selector_events.py | |
| parent | 1515450440f901bdb15e1ad0211a498f54053c3f (diff) | |
| parent | c9d11c341e0e140cb71fab6699fc1b49d8f35436 (diff) | |
| download | cpython-3c28878e401400c6a51edd84d6d550c42e9441b6.zip cpython-3c28878e401400c6a51edd84d6d550c42e9441b6.tar.gz cpython-3c28878e401400c6a51edd84d6d550c42e9441b6.tar.bz2 | |
Merge 3.4 (asyncio)
Diffstat (limited to 'Lib/asyncio/selector_events.py')
| -rw-r--r-- | Lib/asyncio/selector_events.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index 68e9415..7c5b9b5 100644 --- a/Lib/asyncio/selector_events.py +++ b/Lib/asyncio/selector_events.py @@ -408,14 +408,12 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop): def _sock_connect(self, fut, sock, address): fd = sock.fileno() try: - while True: - try: - sock.connect(address) - except InterruptedError: - continue - else: - break - except BlockingIOError: + sock.connect(address) + except (BlockingIOError, InterruptedError): + # Issue #23618: When the C function connect() fails with EINTR, the + # connection runs in background. We have to wait until the socket + # becomes writable to be notified when the connection succeed or + # fails. fut.add_done_callback(functools.partial(self._sock_connect_done, fd)) self.add_writer(fd, self._sock_connect_cb, fut, sock, address) |
