move py2/py3 to _compat.