Skip to content

Commit

Permalink
Update generic_utils.py (#3561)
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 10, 2024
1 parent 5dcc16d commit dbf1a08
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

1 comment on commit dbf1a08

@zyphoria707
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my voice

Please sign in to comment.