Skip to content

Commit 519b0f0

Browse files
authored
Rollup merge of rust-lang#57453 - cuviper:python3-thread, r=nikomatsakis
lldb_batchmode.py: try `import _thread` for Python 3 None
2 parents bff32fc + d9ddc39 commit 519b0f0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/etc/lldb_batchmode.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@
1818
import os
1919
import sys
2020
import threading
21-
import thread
2221
import re
2322
import time
2423

24+
try:
25+
import thread
26+
except ModuleNotFoundError:
27+
# The `thread` module was renamed to `_thread` in Python 3.
28+
import _thread as thread
29+
2530
# Set this to True for additional output
2631
DEBUG_OUTPUT = False
2732

0 commit comments

Comments
 (0)