1 |
From d9ddc39052c91568936427e3dee087b608140cf4 Mon Sep 17 00:00:00 2001 |
2 |
From: Josh Stone <jistone@redhat.com> |
3 |
Date: Tue, 8 Jan 2019 13:19:50 -0800 |
4 |
Subject: [PATCH] lldb_batchmode.py: try `import _thread` for Python 3 |
5 |
|
6 |
--- |
7 |
src/etc/lldb_batchmode.py | 7 ++++++- |
8 |
1 file changed, 6 insertions(+), 1 deletion(-) |
9 |
|
10 |
diff --git a/src/etc/lldb_batchmode.py b/src/etc/lldb_batchmode.py |
11 |
index 6b4c44806740..537b419b3279 100644 |
12 |
--- a/src/etc/lldb_batchmode.py |
13 |
+++ b/src/etc/lldb_batchmode.py |
14 |
@@ -18,10 +18,15 @@ import lldb |
15 |
import os |
16 |
import sys |
17 |
import threading |
18 |
-import thread |
19 |
import re |
20 |
import time |
21 |
|
22 |
+try: |
23 |
+ import thread |
24 |
+except ModuleNotFoundError: |
25 |
+ # The `thread` module was renamed to `_thread` in Python 3. |
26 |
+ import _thread as thread |
27 |
+ |
28 |
# Set this to True for additional output |
29 |
DEBUG_OUTPUT = False |
30 |
|
31 |
-- |
32 |
2.20.1 |
33 |
|