Skip to content

Commit

Permalink
Simply return None if no git repo available
Browse files Browse the repository at this point in the history
This prevents an error when ReBench is used in a project without git repo, or, if the repo is corrupt.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
  • Loading branch information
smarr committed Apr 10, 2020
1 parent 81902da commit 526463e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rebench/environment.py
Expand Up @@ -21,7 +21,10 @@ def _encode_str(out):


def _exec(cmd):
out = subprocess.check_output(cmd)
try:
out = subprocess.check_output(cmd)
except subprocess.CalledProcessError:
return None
return _encode_str(out)


Expand Down

0 comments on commit 526463e

Please sign in to comment.