gh-106320: Remove private _PyOS_IsMainThread() function by vstinner · Pull Request #108605 · python/cpython
-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Merged
Conversation
Member
Move the following private API to the internal C API (pycore_signal.h):
- _PyOS_IsMainThread()
- _PyOS_SigintEvent()
No longer export these functions.
vstinner
added
the
skip news
label
bedevere-bot
mentioned this pull request
bedevere-bot
added
the
awaiting core review
label
Move the following private API to the internal C API (pycore_signal.h): _PyOS_IsMainThread() and _PyOS_SigintEvent().
vstinner
force-pushed
the
pycore_signal
branch
from
063392b to
f3eaba7
Compare
vstinner
enabled auto-merge (squash)
vstinner
merged commit
fadc2dc
into
python:main
bedevere-bot
removed
the
awaiting core review
label
vstinner
deleted the
pycore_signal
branch
jbms
commented
Dec 5, 2024
jbms commented
Contributor
This breaks tensorstore, specifically due to the usage of _PyOS_SigintEvent here: https://github.com/google/tensorstore/blob/798025f874c7579b2eb900932bf7c56d4f8ebd62/python/tensorstore/future.cc#L75
It is used in order to make a blocking wait within the main thread interruptible via Control+C on Windows. I don't know of any easy alternative. For now I will be using the workaround of copying the declaration to my own source file, but if the function is eventually removed entirely that won't work.
vstinner
commented
Dec 11, 2024
vstinner commented
Member Author
Would you mind to open a new issue since this one is closed? Please explain your use case and why you need this function to be exposed.
vstinner
commented
Jan 9, 2025
vstinner commented
Member Author
Ping @jbms.
jbms
mentioned this pull request
jbms
commented
Jan 9, 2025
jbms commented
Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment