Skip to content

add PyErr::display#3334

Merged
adamreichold merged 1 commit intoPyO3:mainfrom
davidhewitt:pyerr-display
Jul 25, 2023
Merged

add PyErr::display#3334
adamreichold merged 1 commit intoPyO3:mainfrom
davidhewitt:pyerr-display

Conversation

@davidhewitt
Copy link
Copy Markdown
Member

@davidhewitt davidhewitt commented Jul 21, 2023

When looking at 3.12 FFI changes I saw the new PyErr_DisplayException and this inspired me to add PyErr::Display for all versions.

While looking at this I noticed that PyErr_PrintEx will call sys.excepthook, so I added this to the documentation.

I think we generally want to be using .display() instead of .print() in tests because there's no meaning to calling sys.excepthook there, so I updated the callsites.

Comment thread src/err/mod.rs
Comment thread newsfragments/3334.added.md Outdated
@adamreichold
Copy link
Copy Markdown
Member

so I added the ...

There seems to be something missing from the above?

@davidhewitt
Copy link
Copy Markdown
Member Author

so I added the ...

There seems to be something missing from the above?

Yes, I meant to say "added to the documentation", got distracted halfway writing 🤦

Comment thread src/err/mod.rs Outdated
@adamreichold adamreichold added this pull request to the merge queue Jul 25, 2023
Merged via the queue into PyO3:main with commit 8ce6c26 Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants