Make doctests pass on both Python2 and Python3