On 4/16/06, John J Lee <[EMAIL PROTECTED]> 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. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com