From f9536ec21c36c86954f53c450c124a99017dde8d Mon Sep 17 00:00:00 2001 From: Amin Alaee Date: Mon, 27 May 2024 11:27:23 +0200 Subject: [PATCH] `time`: Python3.13 updates (#12043) Co-authored-by: Alex Waygood --- stdlib/@tests/stubtest_allowlists/darwin-py313.txt | 3 --- stdlib/@tests/stubtest_allowlists/linux-py313.txt | 1 - stdlib/time.pyi | 5 ++++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/darwin-py313.txt b/stdlib/@tests/stubtest_allowlists/darwin-py313.txt index 6234e5350..4fbe4db57 100644 --- a/stdlib/@tests/stubtest_allowlists/darwin-py313.txt +++ b/stdlib/@tests/stubtest_allowlists/darwin-py313.txt @@ -29,9 +29,6 @@ posix.unlockpt posix.waitid posix.waitid_result readline.backend -time.clock_gettime_ns -time.CLOCK_MONOTONIC_RAW_APPROX -time.CLOCK_UPTIME_RAW_APPROX webbrowser.MacOSX # TODO: fix diff --git a/stdlib/@tests/stubtest_allowlists/linux-py313.txt b/stdlib/@tests/stubtest_allowlists/linux-py313.txt index 927558df1..fb5a1aba2 100644 --- a/stdlib/@tests/stubtest_allowlists/linux-py313.txt +++ b/stdlib/@tests/stubtest_allowlists/linux-py313.txt @@ -159,7 +159,6 @@ syslog.LOG_LAUNCHD syslog.LOG_NETINFO syslog.LOG_RAS syslog.LOG_REMOTEAUTH -time.clock_gettime_ns # Exists on some Linux builds, and is documented, # but is unavailable in Github Actions on Linux with Python 3.12 diff --git a/stdlib/time.pyi b/stdlib/time.pyi index b7962f075..71cdc4d78 100644 --- a/stdlib/time.pyi +++ b/stdlib/time.pyi @@ -27,6 +27,9 @@ if sys.platform != "win32": if sys.platform == "darwin": CLOCK_UPTIME_RAW: int + if sys.version_info >= (3, 13): + CLOCK_UPTIME_RAW_APPROX: int + CLOCK_MONOTONIC_RAW_APPROX: int if sys.version_info >= (3, 9) and sys.platform == "linux": CLOCK_TAI: int @@ -94,7 +97,7 @@ if sys.platform != "win32": def clock_settime(clk_id: int, time: float, /) -> None: ... # Unix only if sys.platform != "win32": - def clock_gettime_ns(clock_id: int, /) -> int: ... + def clock_gettime_ns(clk_id: int, /) -> int: ... def clock_settime_ns(clock_id: int, time: int, /) -> int: ... if sys.platform == "linux":