Skip to content
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

gh-81057: Move Signal-Related Globals to _PyRuntimeState #100085

Merged

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented Dec 7, 2022

@netlify
Copy link

netlify bot commented Dec 7, 2022

Deploy Preview for python-cpython-preview canceled.

Name Link
🔨 Latest commit 38596a0
🔍 Latest deploy log https://app.netlify.com/sites/python-cpython-preview/deploys/6397b5e1a4ac130008314bbc

@ericsnowcurrently ericsnowcurrently force-pushed the consolidate-signal-globals branch 2 times, most recently from b8ae626 to 3b416b1 Compare Dec 8, 2022
@ericsnowcurrently ericsnowcurrently requested a review from a team as a code owner Dec 9, 2022
@ericsnowcurrently ericsnowcurrently force-pushed the consolidate-signal-globals branch 2 times, most recently from 5cd67d8 to c1ac129 Compare Dec 9, 2022
#ifdef MS_WINDOWS
# ifdef PYCORE_SIGNAL_WITH_PRE_INCLUDES
# ifndef SOCKET
# error "<winsock2.h> must be included before this header"
# endif
# ifndef HANDLE
# error "<windows.h> must be included before this header"
# endif
# endif
#endif
Copy link
Member Author

@ericsnowcurrently ericsnowcurrently Dec 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zooba, did I do this right? This is how I understood your recommendation.

Copy link
Member

@zooba zooba Dec 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you want PYCORE_SIGNAL_WITH_PRE_INCLUDES in there. The header file is simply wrong if the system headers haven't been included, so it should always fail.

If the header needs to be used somewhere else, then that somewhere else also needs to include the headers. Alternatively, if it doesn't need to use the values (but just be able to allocate the structures), replace the SOCKET and HANDLE types entirely with void * and do casts anywhere they're actually being used.

Include/internal/pycore_signal.h Outdated Show resolved Hide resolved
Include/internal/pycore_signal.h Outdated Show resolved Hide resolved
Include/internal/pycore_signal.h Outdated Show resolved Hide resolved
Modules/signalmodule.c Outdated Show resolved Hide resolved
@ericsnowcurrently ericsnowcurrently removed the request for review from a team Dec 12, 2022
Modules/signalmodule.c Outdated Show resolved Hide resolved
Python/pylifecycle.c Outdated Show resolved Hide resolved
@ericsnowcurrently ericsnowcurrently merged commit 5eb28bc into python:main Dec 12, 2022
18 checks passed
@ericsnowcurrently ericsnowcurrently deleted the consolidate-signal-globals branch Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants