summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-07-14 18:00:49 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-07-14 18:00:49 (GMT)
commitf64f9e9ec1f8f39dd8c889368ecaad0e198efcb6 (patch)
tree7b843e92fc022ee1c0009a3ecefe69f6f746aba0 /Lib
parentb6ffa7980f2f0fe27efa6cd0e80e511f6bfb00e0 (diff)
downloadcpython-f64f9e9ec1f8f39dd8c889368ecaad0e198efcb6.zip
cpython-f64f9e9ec1f8f39dd8c889368ecaad0e198efcb6.tar.gz
cpython-f64f9e9ec1f8f39dd8c889368ecaad0e198efcb6.tar.bz2
Merge - Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/asyncore.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index d647606..e699815 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -132,7 +132,8 @@ def poll(timeout=0.0, map=None):
is_w = obj.writable()
if is_r:
r.append(fd)
- if is_w:
+ # accepting sockets should not be writable
+ if is_w and not obj.accepting:
w.append(fd)
if is_r or is_w:
e.append(fd)
@@ -179,7 +180,8 @@ def poll2(timeout=0.0, map=None):
flags = 0
if obj.readable():
flags |= select.POLLIN | select.POLLPRI
- if obj.writable():
+ # accepting sockets should not be writable
+ if obj.writable() and not obj.accepting:
flags |= select.POLLOUT
if flags:
# Only check for exceptions if object was either readable