1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

utils/version: Prevent installation failure on systems without git

On systems that do not have git installed devlib will currently fail
to install with a FileNotFound Exception. If git is not present then
we will not have a commit hash so just ignore this error.
This commit is contained in:
Marc Bonnici 2021-01-12 17:04:37 +00:00 committed by setrofim
parent 3b8317d42e
commit 792101819a

View File

@ -33,8 +33,11 @@ def get_devlib_version():
def get_commit(): def get_commit():
try:
p = Popen(['git', 'rev-parse', 'HEAD'], cwd=os.path.dirname(__file__), p = Popen(['git', 'rev-parse', 'HEAD'], cwd=os.path.dirname(__file__),
stdout=PIPE, stderr=PIPE) stdout=PIPE, stderr=PIPE)
except FileNotFoundError:
return None
std, _ = p.communicate() std, _ = p.communicate()
p.wait() p.wait()
if p.returncode: if p.returncode: