Skip to content

GH-90915: Document that SystemExit doesn't trigger sys.excepthook #31357

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

Merged
merged 4 commits into from
Sep 7, 2023

Conversation

cjwatson
Copy link
Contributor

@cjwatson cjwatson commented Feb 15, 2022

This was documented in help(sys), but not in the main library
documentation.

https://bugs.python.org/issue46759

This was documented in `help(sys)`, but not in the main library
documentation.
@bedevere-bot bedevere-bot added the docs Documentation in the Doc dir label Feb 15, 2022
Copy link
Contributor

@MaxwellDupre MaxwellDupre left a comment

Choose a reason for hiding this comment

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

Minor change but worthy.

before the program exits. The handling of such top-level exceptions can be
customized by assigning another three-argument function to ``sys.excepthook``.
When an exception other than :exc:`SystemExit` is raised and uncaught,
the interpreter calls ``sys.excepthook`` with three arguments, the
Copy link
Contributor

@slateny slateny Oct 2, 2022

Choose a reason for hiding this comment

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

Since the lines after the addition of SystemExit don't change, I'd say just make a new line even though it might be shorter than the rest so checking diff is easier

Copy link
Member

Choose a reason for hiding this comment

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

Good idea, I've pushed to un-reflow this. (Also updated the branch from main.)

@kumaraditya303 kumaraditya303 changed the title bpo-46759: Document that SystemExit doesn't trigger sys.excepthook GH-90915: Document that SystemExit doesn't trigger sys.excepthook Jan 5, 2023
@ghost
Copy link

ghost commented Jan 5, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@hugovk hugovk added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Sep 7, 2023
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Thank you!

@hugovk hugovk enabled auto-merge (squash) September 7, 2023 13:04
@hugovk hugovk merged commit 1294fce into python:main Sep 7, 2023
@miss-islington
Copy link
Contributor

Thanks @cjwatson for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@bedevere-bot

This comment was marked as outdated.

@bedevere-bot bedevere-bot requested a review from hugovk September 7, 2023 13:14
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 7, 2023
…ok (pythonGH-31357)

(cherry picked from commit 1294fce)

Co-authored-by: Colin Watson <[email protected]>
Co-authored-by: Kumar Aditya <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-bot
Copy link

GH-109082 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Sep 7, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 7, 2023
…ok (pythonGH-31357)

(cherry picked from commit 1294fce)

Co-authored-by: Colin Watson <[email protected]>
Co-authored-by: Kumar Aditya <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-bot
Copy link

GH-109083 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Sep 7, 2023
hugovk added a commit that referenced this pull request Sep 7, 2023
…ook (GH-31357) (#109083)

Co-authored-by: Colin Watson <[email protected]>
Co-authored-by: Kumar Aditya <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Yhg1s pushed a commit that referenced this pull request Sep 8, 2023
…ook (GH-31357) (#109082)

GH-90915: Document that SystemExit doesn't trigger sys.excepthook (GH-31357)
(cherry picked from commit 1294fce)

Co-authored-by: Colin Watson <[email protected]>
Co-authored-by: Kumar Aditya <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants