Patch doctests to work with Python 3