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-129354: Use PyErr_FormatUnraisable() function #129524

Merged
merged 3 commits into from
Feb 3, 2025

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jan 31, 2025

Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().

Update test_sqlite3 tests.

Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().

Update test_sqlite3 tests.
@vstinner
Copy link
Member Author

vstinner commented Jan 31, 2025

@erlend-aasland: This change uses a more precise error message for sys.unraisablehook errors in sqlite. But it removes the object argument of sys.unraisablehook for modified code, is it ok? IMO it's fine, since nobody should rely on this object argument, and it's uncommon to catch sys.unraisablehook.

Modules/_sqlite/connection.c Outdated Show resolved Hide resolved
Modules/_sqlite/connection.c Outdated Show resolved Hide resolved
vstinner and others added 2 commits February 3, 2025 12:28
Co-authored-by: Erlend E. Aasland <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
@vstinner vstinner enabled auto-merge (squash) February 3, 2025 11:58
@vstinner vstinner merged commit 218f205 into python:main Feb 3, 2025
41 checks passed
@vstinner vstinner deleted the format_unraisable_sqlite branch February 3, 2025 12:10
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Feb 7, 2025
Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().

Update test_sqlite3 tests.

Co-authored-by: Erlend E. Aasland <[email protected]>
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.

2 participants