Skip to content

Commit e4a0545

Browse files
authored
Fix clocks on Windows with Python 3.13 (#8642)
Closes #8641. _WindowsTime is no longer needed on Windows with Python 3.13. On Windows, Python 3.13 now uses GetSystemTimePreciseAsFileTime() for time.time() and QueryPerformanceCounter() for time.monotonic(). * python/cpython#116781 * python/cpython#116822
1 parent d5edb4e commit e4a0545

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

distributed/metrics.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
import collections
5+
import sys
56
import threading
67
import time as timemod
78
from collections.abc import Callable, Hashable, Iterator
@@ -93,7 +94,7 @@ def resync(self) -> None:
9394

9495

9596
# A high-resolution wall clock timer measuring the seconds since Unix epoch
96-
if WINDOWS:
97+
if WINDOWS and sys.version_info < (3, 13):
9798
time = _WindowsTime(timemod.time, is_monotonic=False).time
9899
monotonic = _WindowsTime(timemod.monotonic, is_monotonic=True).time
99100
else:

0 commit comments

Comments
 (0)