Fix doctests with Python 2