bpo-45711: use exc_value instead of exc_type to determine if exc_info is valid. Add more assertions.#29627
Conversation
…engthen redundancy assertion for NULL/None.
|
🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit bc889bc 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
Sorry, something went wrong.
gvanrossum
left a comment
There was a problem hiding this comment.
I noticed that in some places you require type and value to be both "nullish" or both "not nullish" (where "nullish" means either NULL or Py_None), and in other places (in particular in _assert_exception_type_is_redundant()) they are required to both be the same nullishness (i.e., both NULL or both Py_None or neither of them nullish). Is there a reason for the difference?
Sorry, something went wrong.
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Yes. Most of these assertions are verifying that the change right next to them is valid. So if I replace |
Sorry, something went wrong.
gvanrossum
left a comment
There was a problem hiding this comment.
Okay, I'm through now. (Sorry for the premature send on the first batch.)
Sorry, something went wrong.
gvanrossum
left a comment
There was a problem hiding this comment.
All good! (Alas, I'm still stuck trying to wrap my head around the except* implementation, so that one will probably have to wait until next week.)
Sorry, something went wrong.
… is valid. Add more assertions. (pythonGH-29627)
This brings us closer to removing exc_type from exc_info.
Where exc_type is used, I made it use exc_value instead and added assertions that this is ok. Then when we remove exc_type it will just be a matter of removing the assertions.
https://bugs.python.org/issue45711