From: Jonathan Rajotte Date: Wed, 17 Jun 2020 22:40:22 +0000 (-0400) Subject: Fix: python agent: 'time' has no attribute 'clock' X-Git-Tag: v2.13.0-rc1~493 X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=e7bf49685071a4d78dca463c371c02901af90d77;hp=e7bf49685071a4d78dca463c371c02901af90d77;p=lttng-ust.git Fix: python agent: 'time' has no attribute 'clock' The time.clock() function was removed in python 3.8 and is marked as deprecated since python 3.3. See PEP 418 for more details [1]. Solution ===== When the python version is greater than 3.2 use the `time.perf_counter()` function [2]. Otherwise, fall back to `time.clock()`. Introduce a compat module to the lttngust agent package providing the `_clock` function. [1] https://www.python.org/dev/peps/pep-0418/ [2] https://docs.python.org/3/library/time.html#time.perf_counter Signed-off-by: Jonathan Rajotte Signed-off-by: Mathieu Desnoyers Change-Id: I3d6d8b24309d45d43b634dc2a6b4d5dbc12da3aa ---