git_sha1_gen: catch any error the same way

Acked-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
This commit is contained in:
Eric Engestrom
2017-08-02 14:57:52 +01:00
parent 44828e99f9
commit aab0649487

View File

@@ -13,11 +13,8 @@ try:
'--short=10',
'HEAD',
], stderr=open(os.devnull, 'w'))
except subprocess.CalledProcessError as e:
# don't print anything if git fails
pass
except OSError as eos:
# don't fail on inaccessible files when sandboxed
except:
# don't print anything if it fails
pass
else:
sys.stdout.write('#define MESA_GIT_SHA1 "git-%s"\n' % git_sha1.rstrip())