]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] Revert "gh-123974: Fix time.get_clock_info() on NetBSD (GH-123975)" (GH-124115...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 18 Sep 2024 06:47:17 +0000 (08:47 +0200)
committerGitHub <noreply@github.com>
Wed, 18 Sep 2024 06:47:17 +0000 (06:47 +0000)
This reverts commit b1d6f8a2ee04215c64aa8752cc515b7e98a08d28.
(cherry picked from commit 79a74102362996bbd4ff5d410a0d57d43c236da4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Modules/timemodule.c

index 124efc8364bfd74de2d7bff5ea6acfb94d77312b..8613fccfe0224955b8d78d2c7c18af9c454f0a38 100644 (file)
@@ -1525,19 +1525,15 @@ _PyTime_GetThreadTimeWithInfo(_PyTime_t *tp, _Py_clock_info_t *info)
         return -1;
     }
     if (info) {
+        struct timespec res;
         info->implementation = function;
         info->monotonic = 1;
         info->adjustable = 0;
-    #if defined(__NetBSD__)
-        info->resolution = 1e-9;
-    #else
-        struct timespec res;
         if (clock_getres(clk_id, &res)) {
             PyErr_SetFromErrno(PyExc_OSError);
             return -1;
         }
         info->resolution = res.tv_sec + res.tv_nsec * 1e-9;
-    #endif
     }
 
     if (_PyTime_FromTimespec(tp, &ts) < 0) {