> Tim Peters <tim.one@comcast.net> writes: > > > doctest.py: I Trust Tim (tm) > > > > Me too. The first bare except is exec'ing arbitrary user-supplied > > code, and needs to catch everything. The second needs to ignore > > any exception that may be raised by a user-define __str__, and > > that's any exception whatsoever, so ditto. > > One observation in the bug report is that atleast KeyboardInterrupt > needs to get a chance to get through, making bare except clauses evil > under almost any circumstance. > > Regards, > Martin That would explain why sometimes I have to hit ^C twice to kill the test suite. There's a standard idiom for this: try: ...code... except KeyboardInterrupt: raise except: ...handler... That's easy enough to add to doctest (I looked and it seems obvious that this will work). --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4