Format doctest suitable for Python 2