Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DeepFilterNet/df/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def get_git_root():
git_local_dir = os.path.dirname(os.path.abspath(__file__))
args = ["git", "-C", git_local_dir, "rev-parse", "--show-toplevel"]
return subprocess.check_output(args).strip().decode()
except subprocess.CalledProcessError:
except (subprocess.CalledProcessError, FileNotFoundError):
return None


Expand All @@ -154,7 +154,7 @@ def get_commit_hash():
return None
args = ["git", "-C", git_dir, "rev-parse", "--short", "--verify", "HEAD"]
return subprocess.check_output(args).strip().decode()
except subprocess.CalledProcessError:
except (subprocess.CalledProcessError, FileNotFoundError):
# probably not in git repo
return None

Expand All @@ -168,7 +168,7 @@ def get_branch_name():
git_dir = os.path.dirname(os.path.abspath(__file__))
args = ["git", "-C", git_dir, "rev-parse", "--abbrev-ref", "HEAD"]
branch = subprocess.check_output(args).strip().decode()
except subprocess.CalledProcessError:
except (subprocess.CalledProcessError, FileNotFoundError):
# probably not in git repo
branch = None
return branch
Expand Down