Skip to content

gh-141004: Document PyOS_InterruptOccurred - #141526

Merged
ZeroIntensity merged 4 commits into
python:mainfrom
StanFromIreland:PyOS_InterruptOccurred
Nov 14, 2025
Merged

ZeroIntensity merged 4 commits into
python:mainfrom
StanFromIreland:PyOS_InterruptOccurred

Conversation

@StanFromIreland

@StanFromIreland StanFromIreland commented Nov 13, 2025 •

Copy link
Copy Markdown
Member
Comment thread Modules/signalmodule.c Resolved
Comment thread Doc/c-api/sys.rst Resolved
Comment thread Doc/c-api/sys.rst Resolved

@ZeroIntensity ZeroIntensity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nearly there!

Comment thread Doc/c-api/sys.rst Resolved
Comment thread Doc/c-api/sys.rst Resolved
@ZeroIntensity ZeroIntensity added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Nov 13, 2025

@ZeroIntensity ZeroIntensity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@ZeroIntensity
ZeroIntensity merged commit ef90261 into python:main Nov 14, 2025
@miss-islington-app

Copy link
Copy Markdown

Thanks @StanFromIreland for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 14, 2025
(cherry picked from commit ef90261)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@bedevere-app

bedevere-app Bot commented Nov 14, 2025

Copy link
Copy Markdown

GH-141549 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Nov 14, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 14, 2025
(cherry picked from commit ef90261)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@bedevere-app

bedevere-app Bot commented Nov 14, 2025

Copy link
Copy Markdown

GH-141550 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Nov 14, 2025
ZeroIntensity pushed a commit that referenced this pull request Nov 14, 2025
…41549)

gh-141004: Document `PyOS_InterruptOccurred` (GH-141526)
(cherry picked from commit ef90261)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@vstinner

Copy link
Copy Markdown
Member

The documentation doesn't mention that the function always returns 0 if called from a thread which is not the main thread, or an interpreter which is not the main interpreter. Only the main thread of the main interpreter can return 1.

@ZeroIntensity

Copy link
Copy Markdown
Member

I thought about that, but I didn't think it was particularly important; it's technically an implementation detail, it's not too noticeable in practice, and most people should use PyErr_CheckSignals anyway. Feel free to submit a follow-up PR if you feel strongly about documenting that.

ZeroIntensity pushed a commit that referenced this pull request Nov 14, 2025
…41550)

gh-141004: Document `PyOS_InterruptOccurred` (GH-141526)
(cherry picked from commit ef90261)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
StanFromIreland added a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants