Skip to content
Draft
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
19 changes: 12 additions & 7 deletions plugins/python/python_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,18 @@ void uwsgi_python_post_fork() {

// reset python signal flags so child processes can trap signals
// Necessary if uwsgi fork hooks not called to update interpreter state
if (!up.call_uwsgi_fork_hooks && up.call_osafterfork) {
#ifdef HAS_NOT_PYOS_FORK_STABLE_API
PyOS_AfterFork();
#else
PyOS_AfterFork_Child();
#endif
}
#if PY_VERSION_HEX < 0x030D0000
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please move preprocessor directives to column 0, also you can use #ifdef UWSGI_PY313

if (!up.call_uwsgi_fork_hooks && up.call_osafterfork) {
// before python 3.7
#ifdef HAS_NOT_PYOS_FORK_STABLE_API
PyOS_AfterFork();
Copy link
Collaborator

Choose a reason for hiding this comment

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

looks like there's one tab too much


// python 3.7 - 3.12
#else
PyOS_AfterFork_Child();
#endif
}
#endif

uwsgi_python_reset_random_seed();

Expand Down