Skip to content

Commit ac0ad50

Browse files
authored
[lldb] Use PyThread_get_thread_ident instead of accessing PyThreadState (#153460)
Use `PyThread_get_thread_ident`, which is part of the Stable API, instead of accessing a member of the PyThreadState, which is opaque when using the Stable API.
1 parent 91418ec commit ac0ad50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,11 +909,11 @@ bool ScriptInterpreterPythonImpl::Interrupt() {
909909
Log *log = GetLog(LLDBLog::Script);
910910

911911
if (IsExecutingPython()) {
912-
PyThreadState *state = PyThreadState_GET();
912+
PyThreadState *state = PyThreadState_Get();
913913
if (!state)
914914
state = GetThreadState();
915915
if (state) {
916-
long tid = state->thread_id;
916+
long tid = PyThread_get_thread_ident();
917917
PyThreadState_Swap(state);
918918
int num_threads = PyThreadState_SetAsyncExc(tid, PyExc_KeyboardInterrupt);
919919
LLDB_LOGF(log,

0 commit comments

Comments
 (0)