Skip to content

Commit a9484d4

Browse files
author
Thomas Bächler
committed
Make x.py compatible with python 3.8.
Python 3.8 removes the time.clock() function, use time.perf_counter() instead.
1 parent cdb50c6 commit a9484d4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/etc/lldb_batchmode.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,17 @@ def listen():
139139
def start_watchdog():
140140
"""Starts a watchdog thread that will terminate the process after a certain
141141
period of time"""
142-
watchdog_start_time = time.clock()
142+
143+
try:
144+
from time import clock
145+
except ImportError:
146+
from time import perf_counter as clock
147+
148+
watchdog_start_time = clock()
143149
watchdog_max_time = watchdog_start_time + 30
144150

145151
def watchdog():
146-
while time.clock() < watchdog_max_time:
152+
while clock() < watchdog_max_time:
147153
time.sleep(1)
148154
print("TIMEOUT: lldb_batchmode.py has been running for too long. Aborting!")
149155
thread.interrupt_main()

0 commit comments

Comments
 (0)