[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.
This commit is contained in:
1 parent
91418ecbde
commit
ac0ad5093a
1 file changed
+2
-2
@@ -909,11 +909,11 @@ bool ScriptInterpreterPythonImpl::Interrupt() {
|
||||
Log *log = GetLog(LLDBLog::Script);
|
||||
|
||||
if (IsExecutingPython()) {
|
||||
PyThreadState *state = PyThreadState_GET();
|
||||
PyThreadState *state = PyThreadState_Get();
|
||||
if (!state)
|
||||
state = GetThreadState();
|
||||
if (state) {
|
||||
long tid = state->thread_id;
|
||||
long tid = PyThread_get_thread_ident();
|
||||
PyThreadState_Swap(state);
|
||||
int num_threads = PyThreadState_SetAsyncExc(tid, PyExc_KeyboardInterrupt);
|
||||
LLDB_LOGF(log,
|
||||
|
||||
Reference in new issue
Block a user