Commit d8ce87ad authored by Thomas Heller's avatar Thomas Heller

On Windows, select() does not accept empty lists.

Patch suggested by Guido, fixes SF item 611464.

Bugfix candidate, will backport to release22-maint myself.
parent 7bdabe67
...@@ -50,6 +50,7 @@ import exceptions ...@@ -50,6 +50,7 @@ import exceptions
import select import select
import socket import socket
import sys import sys
import time
import os import os
from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \ from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \
...@@ -100,10 +101,13 @@ def poll(timeout=0.0, map=None): ...@@ -100,10 +101,13 @@ def poll(timeout=0.0, map=None):
r.append(fd) r.append(fd)
if obj.writable(): if obj.writable():
w.append(fd) w.append(fd)
if [] == r == w == e:
time.sleep(timeout)
else:
try: try:
r, w, e = select.select(r, w, e, timeout) r, w, e = select.select(r, w, e, timeout)
except select.error, err: except select.error, err:
if err[0] != EINTR: if err[0] not in (EINTR, ENOENT):
raise raise
for fd in r: for fd in r:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment