This patch fixes (adds) behavior of thread_time is Solaris which doesn't support clock_gettime(CLOCK_THREAD_CPUTIME_ID) method. This was submitted upstream: https://bugs.python.org/issue35455 --- Python-3.7.3/Modules/timemodule.c +++ Python-3.7.3/Modules/timemodule.c @@ -1325,6 +1325,25 @@ _PyTime_GetThreadTimeWithInfo(_PyTime_t return 0; } +#elif defined(__sun) && defined(__SVR4) +#define HAVE_THREAD_TIME +static int +_PyTime_GetThreadTimeWithInfo(_PyTime_t *tp, _Py_clock_info_t *info) +{ + _PyTime_t t; + + if (info) { + info->implementation = "gethrvtime()"; + info->resolution = 1e-9; + info->monotonic = 1; + info->adjustable = 0; + } + + t = _PyTime_FromNanoseconds(gethrvtime()); + *tp = t; + return 0; +} + #elif defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_PROCESS_CPUTIME_ID) #define HAVE_THREAD_TIME static int