Skip to content

posixmodule uses PyOS_setsig to save & restore signal handlers #114727

Description

@encukou

posixmodule ignores signals in os_openpty_impl and os_grantpt_impl by wrapping them in two PyOS_setsig calls:

   sig_saved = PyOS_setsig(SIGCHLD, SIG_DFL);
    ...
    PyOS_setsig(SIGCHLD, sig_saved);

This relies on the GIL being held, so it probably needs a dedicated lock in free-threading builds.

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions