X Tutup
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Lib/asyncio/base_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@
import errno
import heapq
import itertools
import math
import os
import socket
import stat
import subprocess
import sys
import threading
import time
import traceback
import sys
import warnings
import weakref

Expand Down Expand Up @@ -2022,7 +2023,10 @@ def _run_once(self):
event_list = None

# Handle 'later' callbacks that are ready.
end_time = self.time() + self._clock_resolution
now = self.time()
# Ensure that `end_time` is strictly increasing
# when the clock resolution is too small.
end_time = now + max(self._clock_resolution, math.ulp(now))
while self._scheduled:
handle = self._scheduled[0]
if handle._when >= end_time:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:mod:`asyncio`: Make sure that :meth:`loop.call_at <asyncio.loop.call_at>` and
:meth:`loop.call_later <asyncio.loop.call_later>` trigger scheduled events on
time when the clock resolution becomes too small.
Loading
X Tutup