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>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
This commit is contained in:
Alejandro Mery 2017-03-01 14:19:08 +00:00 committed by Armin Kuster
parent 1ec6d57e43
commit 2a53b11d6c

View File

@ -27,13 +27,13 @@ def get_git_pv(path, d, tagadjust=None):
gitdir = os.path.abspath(os.path.join(d.getVar("S", True), ".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: