File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1919import errno
2020import heapq
2121import itertools
22+ import math
2223import os
2324import socket
2425import stat
2526import subprocess
27+ import sys
2628import threading
2729import time
2830import traceback
29- import sys
3031import warnings
3132import weakref
3233
@@ -2022,7 +2023,10 @@ def _run_once(self):
20222023 event_list = None
20232024
20242025 # Handle 'later' callbacks that are ready.
2025- end_time = self .time () + self ._clock_resolution
2026+ now = self .time ()
2027+ # Ensure that `end_time` is strictly increasing
2028+ # when the clock resolution is too small.
2029+ end_time = now + max (self ._clock_resolution , math .ulp (now ))
20262030 while self ._scheduled :
20272031 handle = self ._scheduled [0 ]
20282032 if handle ._when >= end_time :
Original file line number Diff line number Diff line change 1+ :mod: `asyncio `: Make sure that :meth: `loop.call_at <asyncio.loop.call_at> ` and
2+ :meth: `loop.call_later <asyncio.loop.call_later> ` trigger scheduled events on
3+ time when the clock resolution becomes too small.
You can’t perform that action at this time.
0 commit comments