[Python-porting] Porting Doctest exceptions

Lennart Regebro regebro at gmail.com
Sat Dec 13 12:45:02 CET 2008


In Python 2, an exception looks like this:

    Traceback (most recent call last):
      blahlalablablabl
    TheExceptionClass: Eh, something broke!

Python Python 3, an exception looks like this:

    Traceback (most recent call last):
      blahlalablablabl
    themodule.TheExceptionClass: Eh, something broke!

That extra "themodule." breaks every known doctest that checks for
exceptions in the universe, and I can't find any way of writing the
test that will work in both.

Any ideas of how to solve this?

-- 
Lennart Regebro: Zope and Plone consulting.
http://www.colliberty.com/
+33 661 58 14 64


More information about the Python-porting mailing list