homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients berker.peksag, martin.panter, matrixise, pitrou, rhettinger, serhiy.storchaka, terry.reedy, vstinner
Date 2015年05月20日.16:54:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1432140888.97.0.153730917323.issue21259@psf.upfronthosting.co.za>
In-reply-to
Content
A couple of years ago, when I pushed 'except: pass', I was told in post-review that grandfathered bad code is no excuse for more bad code and that I should be explicit, including if I actually meant "except BaseException:", which in this case I did. No other developer said otherwise. I took the above to be the general consensus. I agree with it, one reason being that bare excepts are speed bumps when reading someone else's code.
Victor> generic change "except: pass" to "except Exception: pass"
This is not correct without case-by-case examination.
#16261 had 2 patches. The patch for doc examples changed 3 'except:'s to 'except Exception:' I believe these are correct, or correct enough. They all need to *not* catch KeyboardInterrupt. The patch for lib code never changed to Exception, but something tighter.
The patch committed for #16261 patched 7 files (down from the original proposed 11). Even that took a couple of years to get a second review. I think further followup patches should probably change even fewer files and be attached to new, narrowly focused issues.
Raymond, since you closed this once, and since no new patch has been submitted, I presume you do not mind if I reclose this.
History
Date User Action Args
2015年05月20日 16:54:49terry.reedysetrecipients: + terry.reedy, rhettinger, pitrou, vstinner, berker.peksag, martin.panter, serhiy.storchaka, matrixise
2015年05月20日 16:54:48terry.reedysetmessageid: <1432140888.97.0.153730917323.issue21259@psf.upfronthosting.co.za>
2015年05月20日 16:54:48terry.reedylinkissue21259 messages
2015年05月20日 16:54:48terry.reedycreate

AltStyle によって変換されたページ (->オリジナル) /