docs/conf.py: add py2/py3-tolerance

This commit is contained in:
Brian Warner 2019-05-05 18:05:56 -04:00
parent 49ab25ff34
commit 2f8873f50a

View File

@ -64,6 +64,8 @@ def _get_versions():
parent = os.path.dirname(here)
v = subprocess.check_output([sys.executable, "setup.py", "--version"],
cwd=parent)
if sys.version_info[0] >= 3:
v = v.decode()
short = ".".join(v.split(".")[:2])
long = v
return short, long