Skip to content

Commit dbf1a08

Browse files
author
Nick Potafiy
authored
Update generic_utils.py (#3561)
Handles cases when git branch produces no output or invalid output. Right now, it just crashes with `StopIteration`
1 parent 5dcc16d commit dbf1a08

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

TTS/utils/generic_utils.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ def get_git_branch():
3636
current.replace("* ", "")
3737
except subprocess.CalledProcessError:
3838
current = "inside_docker"
39-
except FileNotFoundError:
40-
current = "unknown"
41-
except StopIteration:
39+
except (FileNotFoundError, StopIteration) as e:
4240
current = "unknown"
4341
return current
4442

0 commit comments

Comments
 (0)