lldb_batchmode.py: try `import _thread` for Python 3
authorJosh Stone <jistone@redhat.com>
Tue, 8 Jan 2019 21:19:50 +0000 (13:19 -0800)
committerXimin Luo <infinity0@debian.org>
Mon, 28 Jan 2019 06:02:48 +0000 (06:02 +0000)
Gbp-Pq: Name u-0001-lldb_batchmode.py-try-import-_thread-for-Python-3.patch

src/etc/lldb_batchmode.py

index b0220c84ef2fa78216a1e20a967c993003789bda..6def5ea526891ff755396749614ba83525d73af0 100644 (file)
@@ -28,10 +28,15 @@ import lldb
 import os
 import sys
 import threading
-import thread
 import re
 import time
 
+try:
+    import thread
+except ModuleNotFoundError:
+    # The `thread` module was renamed to `_thread` in Python 3.
+    import _thread as thread
+
 # Set this to True for additional output
 DEBUG_OUTPUT = False