summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-07-14 17:57:35 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-07-14 17:57:35 (GMT)
commit1f0ccfa853dcc68d3c2d5b92d22fa0c8e1321b63 (patch)
treec2ea730702afc000ccbce1c804b92e3e23bc68f6 /Lib
parenteef80b6e70f9fe2a1120a611ebc0889e6936eb16 (diff)
downloadcpython-1f0ccfa853dcc68d3c2d5b92d22fa0c8e1321b63.zip
cpython-1f0ccfa853dcc68d3c2d5b92d22fa0c8e1321b63.tar.gz
cpython-1f0ccfa853dcc68d3c2d5b92d22fa0c8e1321b63.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 5d7bdda..7f42d39 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