make doctest pass on py3