Skip to content

Fix 3.14 beta break with _handle on thread #1895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
# 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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
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,
Expand Down Expand Up @@ -267,7 +268,7 @@ def is_thread_alive(self):
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:
Expand Down
Loading
Loading