summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-07-14 17:49:02 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-07-14 17:49:02 (GMT)
commit2659140a5d0fbace2826320c0c3130e356c3c94b (patch)
tree75f11495eb06593a22ca7f398fc3bd5395acf7c2 /Lib
parentb30ac940db4ef062ea708d1e60a59931e2514a6f (diff)
downloadcpython-2659140a5d0fbace2826320c0c3130e356c3c94b.zip
cpython-2659140a5d0fbace2826320c0c3130e356c3c94b.tar.gz
cpython-2659140a5d0fbace2826320c0c3130e356c3c94b.tar.bz2
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 1a623db..35db387 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