add Python 3.14 compatible logic to check if a thread is alive#305
Open
lancelote wants to merge 2 commits intofabioz:mainfrom
Open
add Python 3.14 compatible logic to check if a thread is alive#305lancelote wants to merge 2 commits intofabioz:mainfrom
lancelote wants to merge 2 commits intofabioz:mainfrom
Conversation
fabioz
reviewed
May 21, 2025
| return not self.thread._is_stopped | ||
| else: | ||
| return not self.thread._handle.is_done() | ||
| return is_thread_alive(self.thread) |
Owner
There was a problem hiding this comment.
Ideally any checks for Python 3.12 onwards would be done here and not delegated to a pure-python implementation (i.e.: the constructor should determine which check to do and here it uses the proper approach without calling out to non-cython code).
- don't import extra pure-Python code - cache `hasattr` calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi Fabio, hope you are doing great.
Python 3.14.0b1 is available, and I'm experimenting with adopting it for my projects. Unfortunately, the debugger is not yet compatible with it. I'm currently looking into fixing it in PyCharm, and decided to first open a PR upstream. Would you consider contributions for Python 3.14 support, or is it too early?
Speaking of the changes ...
_handlewas renamed to_os_thread_handlein [3.13] gh-132578: Rename thethreading.Thread._handlefield (GH-132696) python/cpython#132789_pydev_bundle/pydev_is_thread_alive.py. Given that - was there a special reason why you didn't use it in_pydevd_sys_monitoring/_pydevd_sys_monitoring.py?_pydevd_sys_monitoring/_pydevd_sys_monitoring_cython.pyxwithbuild_tools/generate_code.py_pydev_bundle/pydev_is_thread_alive.pyyou write "Hack for https://www.brainwy.com/tracker/PyDev/363", I wonder if this is still relevant in the Python >=3.8 world, perhaps the whole module could be drastically simplifiedThank you for your time.