summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-01-31 11:12:53 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-01-31 11:12:53 (GMT)
commitdcd9740ad2932f4049e912d8721933696373fe4c (patch)
tree2827fc31b7e57e7bac925f338303c8acf33a1011 /Lib/asyncio
parent31f65044a977307915412edffddcb4962a8928a3 (diff)
downloadcpython-dcd9740ad2932f4049e912d8721933696373fe4c.zip
cpython-dcd9740ad2932f4049e912d8721933696373fe4c.tar.gz
cpython-dcd9740ad2932f4049e912d8721933696373fe4c.tar.bz2
Issue #20452: select and selectors round (again) timeout away from zero for
poll and epoll Improve also debug info to analyze the issue
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/base_events.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index 4b8e3fe..05a4c38 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -627,16 +627,11 @@ class BaseEventLoop(events.AbstractEventLoop):
t1 = self.time()
# FIXME: remove these debug info (issue #20452)
dt = t1-t0
- if timeout is not None:
- if dt < timeout and not event_list:
- print("WARNING: selector.select(timeout=%.20f) took dt=%.20f sec (dt-timeout=%+.20f)"
- % (timeout, dt, dt-timeout), file=sys.__stdout__)
- print("WARNING: dt+%.20f > timeout? %s"
- % (self._granularity, (dt + self._granularity) > timeout), file=sys.__stdout__)
- else:
- if not event_list:
- print("WARNING: selector.select(timeout=%r) took dt=%.20f sec"
- % (timeout, dt), file=sys.__stdout__)
+ if timeout is not None and dt < timeout and not event_list:
+ print("WARNING: selector.select(timeout=%.20f) took dt=%.20f sec (dt-timeout=%+.20f)"
+ % (timeout, dt, dt-timeout), file=sys.__stdout__)
+ print("WARNING: dt+%.20f > timeout? %s"
+ % (self._granularity, (dt + self._granularity) > timeout), file=sys.__stdout__)
if t1-t0 >= 1:
level = logging.INFO
else: