mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Fix 3.14 beta break with _handle on thread (#1895)
This commit is contained in:
parent
8b5b84aec3
commit
4bc7343c05
4 changed files with 3517 additions and 3487 deletions
|
|
@ -5,6 +5,10 @@ from _pydev_bundle._pydev_saved_modules import threading
|
|||
# It is required to debug threads started by start_new_thread in Python 3.4
|
||||
_temp = threading.Thread()
|
||||
|
||||
if hasattr(_temp, "_os_thread_handle"): # Python 3.14 and later has this
|
||||
def is_thread_alive(t):
|
||||
return not t._os_thread_handle.is_done()
|
||||
|
||||
if hasattr(_temp, "_handle") and hasattr(_temp, "_started"): # Python 3.13 and later has this
|
||||
|
||||
def is_thread_alive(t):
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ from typing import Dict, Optional, Tuple, Any
|
|||
from os.path import basename, splitext
|
||||
|
||||
from _pydev_bundle import pydev_log
|
||||
from _pydev_bundle.pydev_is_thread_alive import is_thread_alive as pydevd_is_thread_alive
|
||||
from _pydevd_bundle import pydevd_dont_trace
|
||||
from _pydevd_bundle.pydevd_constants import (
|
||||
IS_PY313_OR_GREATER,
|
||||
|
|
@ -267,7 +268,7 @@ class ThreadInfo:
|
|||
if self._use_is_stopped:
|
||||
return not self.thread._is_stopped
|
||||
else:
|
||||
return not self.thread._handle.is_done()
|
||||
return pydevd_is_thread_alive(self.thread)
|
||||
|
||||
|
||||
class _DeleteDummyThreadOnDel:
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -19,6 +19,7 @@ from typing import Dict, Optional, Tuple, Any
|
|||
from os.path import basename, splitext
|
||||
|
||||
from _pydev_bundle import pydev_log
|
||||
from _pydev_bundle.pydev_is_thread_alive import is_thread_alive as pydevd_is_thread_alive
|
||||
from _pydevd_bundle import pydevd_dont_trace
|
||||
from _pydevd_bundle.pydevd_constants import (
|
||||
IS_PY313_OR_GREATER,
|
||||
|
|
@ -273,7 +274,7 @@ cdef class ThreadInfo:
|
|||
if self._use_is_stopped:
|
||||
return not self.thread._is_stopped
|
||||
else:
|
||||
return not self.thread._handle.is_done()
|
||||
return pydevd_is_thread_alive(self.thread)
|
||||
|
||||
|
||||
class _DeleteDummyThreadOnDel:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue