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:
parent
3b8317d42e
commit
792101819a
@ -33,8 +33,11 @@ def get_devlib_version():
|
||||
|
||||
|
||||
def get_commit():
|
||||
p = Popen(['git', 'rev-parse', 'HEAD'], cwd=os.path.dirname(__file__),
|
||||
stdout=PIPE, stderr=PIPE)
|
||||
try:
|
||||
p = Popen(['git', 'rev-parse', 'HEAD'], cwd=os.path.dirname(__file__),
|
||||
stdout=PIPE, stderr=PIPE)
|
||||
except FileNotFoundError:
|
||||
return None
|
||||
std, _ = p.communicate()
|
||||
p.wait()
|
||||
if p.returncode:
|
||||
|
Loading…
x
Reference in New Issue
Block a user