Remove old-style sys.exc_info and sys.print_exception usage in favor of caught exception#2585
Conversation
442fa31 to
da55f70
Compare
|
I'm having trouble getting excited by these kinds of PRs - I agree it's arguably "better", and indeed if it was code written today we'd insist on it. However, I've not seen evidence that this fixes anything in practice but instead introduces risk of regressions and otherwise has marginal benefits, if any. I'd be in favour of changing code that's otherwise already being touched to have these kinds of improvments, but I'm not really in favor of general "improvement" changes with no clear justification other than "it's how it would have been written if it was written today". I'm even fine with auto-fix changes from quality tools in our CI (eg, via Ruff) but less motivated by self-selected and hand-written fixes. |
|
Alright, I'll close this PR (it stays as a reference point anyway). Some of those may come back up whilst adding annotations for editors/intellisence/type-checkers. As a note for |
Simplifies a lot of exception handling code
Slight overlap with #2285 (merging either first will reduce changes in a file)
I left exception-raising hacks for #2462