py/makeversionhdr.py: Work with backslashes in paths.

This script may be called by Windows IDEs (e.g. Visual Studio) and be passed
paths with backslashes.
This commit is contained in:
omtinez 2015-10-29 19:16:48 -07:00 committed by Paul Sokolovsky
parent 6f70283909
commit 17c649da3d

View File

@ -57,7 +57,7 @@ def get_version_info_from_git():
return git_tag, git_hash, ver
def get_version_info_from_docs_conf():
with open("%s/docs/conf.py" % sys.argv[0].rsplit("/", 2)[0]) as f:
with open(os.path.join(os.path.dirname(sys.argv[0]), "..", "docs", "conf.py")) as f:
for line in f:
if line.startswith("release = '"):
ver = line.strip()[10:].strip("'")