From dbf1a08a0d4e47fdad6172e433eeb34bc6b13b4e Mon Sep 17 00:00:00 2001 From: Nick Potafiy <155690133+nickpotafiy@users.noreply.github.com> Date: Sat, 10 Feb 2024 09:20:58 -0500 Subject: [PATCH] Update generic_utils.py (#3561) Handles cases when git branch produces no output or invalid output. Right now, it just crashes with `StopIteration` --- TTS/utils/generic_utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/TTS/utils/generic_utils.py b/TTS/utils/generic_utils.py index 9730576239..4fa4741ab7 100644 --- a/TTS/utils/generic_utils.py +++ b/TTS/utils/generic_utils.py @@ -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