summaryrefslogtreecommitdiff
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-02-11 00:15:46 -0800
committerLarry Hastings <larry@hastings.org>2014-02-11 00:15:46 -0800
commit3f99504c08ebca685271c32289f8907bc456e1fc (patch)
treedeb0b2d3284cec1323ad0da34f96107ea3f64576 /Lib/asyncio
parent4cce8f2f40cc15235f44b3a47fec0444ed75e9fe (diff)
parent06847d9c8c30715c077e083de1c511e399af75f1 (diff)
downloadcpython-git-3f99504c08ebca685271c32289f8907bc456e1fc.tar.gz
Merge Python 3.4.0rc1 release branch.
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/base_events.py5
-rw-r--r--Lib/asyncio/test_utils.py1
2 files changed, 4 insertions, 2 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index 4207a7e9f1..377ea216f7 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -96,6 +96,7 @@ class BaseEventLoop(events.AbstractEventLoop):
self._default_executor = None
self._internal_fds = 0
self._running = False
+ self._clock_resolution = time.get_clock_info('monotonic').resolution
def _make_socket_transport(self, sock, protocol, waiter=None, *,
extra=None, server=None):
@@ -643,10 +644,10 @@ class BaseEventLoop(events.AbstractEventLoop):
self._process_events(event_list)
# Handle 'later' callbacks that are ready.
- now = self.time()
+ end_time = self.time() + self._clock_resolution
while self._scheduled:
handle = self._scheduled[0]
- if handle._when > now:
+ if handle._when >= end_time:
break
handle = heapq.heappop(self._scheduled)
self._ready.append(handle)
diff --git a/Lib/asyncio/test_utils.py b/Lib/asyncio/test_utils.py
index 71d69cfacc..7c8e1dcbd6 100644
--- a/Lib/asyncio/test_utils.py
+++ b/Lib/asyncio/test_utils.py
@@ -191,6 +191,7 @@ class TestLoop(base_events.BaseEventLoop):
self._gen = gen()
next(self._gen)
self._time = 0
+ self._clock_resolution = 1e-9
self._timers = []
self._selector = TestSelector()