From b59ff9c1fe57d474a83a67aff8ddfff6fe9f15c4 Mon Sep 17 00:00:00 2001 From: Shahbaz Youssefi Date: Fri, 11 Jan 2019 22:50:12 -0500 Subject: [PATCH] Make genvk.py work in Python2 (#894) As a quick workaround, the Python3-specific function time.process_time() is conditioned to the `timeit` parameter. Indeed, if this parameter is not set, there is no point in getting the process time anyway. Unblocks rolling Vulkan dependencies in Google's ANGLE. Signed-off-by: Shahbaz Youssefi --- xml/genvk.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xml/genvk.py b/xml/genvk.py index 706b8e3f..d221913f 100755 --- a/xml/genvk.py +++ b/xml/genvk.py @@ -30,12 +30,13 @@ startTime = None def startTimer(timeit): global startTime - startTime = time.process_time() + if timeit: + startTime = time.process_time() def endTimer(timeit, msg): global startTime - endTime = time.process_time() - if (timeit): + if timeit: + endTime = time.process_time() write(msg, endTime - startTime, file=sys.stderr) startTime = None