On 4/16/06, John J Lee <jjl at pobox.com> wrote: > OK, I suppose I should have asked "will 2.5's module traceback work with > Python 2.4?". I guess the answer is something resembling "no", but of > course (?) the question I'm really interested in is "how, without too much > effort or ugliness, can people run their doctests on both 2.4 and 2.5"? I think there was an example earlier - you could change your doctest to not rely on the exact exception by catching it: >>> try: ... 1/0 ... except ZeroDivisionError: ... print "Divide by zero!" ... Divide by zero! >>> Whether that counts as "too much effort or ugliness", I'm not sure. Personally, my instinct is that having the whole traceback in a doctest is at least as ugly. Paul.
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