Skip to content

Commit

Permalink
Update generic_utils.py
Browse files Browse the repository at this point in the history
Handles cases when git branch produces no output or invalid output. Right now, it just crashes with `StopIteration`
  • Loading branch information
Nick Potafiy authored Feb 4, 2024
1 parent 5dcc16d commit e2940d7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions TTS/utils/generic_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ def get_git_branch():
current.replace("* ", "")
except subprocess.CalledProcessError:
current = "inside_docker"
except FileNotFoundError:
current = "unknown"
except StopIteration:
except (FileNotFoundError, StopIteration) as e:
current = "unknown"
return current

Expand Down

0 comments on commit e2940d7

Please sign in to comment.