gitver: fix try/except syntax for python3 support

https://www.python.org/dev/peps/pep-3110/

It's backward compatible with 2.6+

Signed-off-by: Alejandro Mery <amery@hanoverdisplays.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
Alejandro Mery
2017-03-01 14:19:08 +00:00
committed by Martin Jansa
parent 0c31f55bcf
commit b17bbbe224

View File

@@ -27,13 +27,13 @@ def get_git_pv(path, d, tagadjust=None):
gitdir = os.path.abspath(os.path.join(d.getVar("S"), ".git"))
try:
ver = gitrev_run("git describe --tags", gitdir)
except Exception, exc:
except Exception as exc:
bb.fatal(str(exc))
if not ver:
try:
ver = gitrev_run("git rev-parse --short HEAD", gitdir)
except Exception, exc:
except Exception as exc:
bb.fatal(str(exc))
if ver: