From e2940d733e4958f6cd015ce1c0c6f2c2a4898c3d Mon Sep 17 00:00:00 2001 From: Nick Potafiy <155690133+nickpotafiy@users.noreply.github.com> Date: Sat, 3 Feb 2024 23:48:44 -0500 Subject: [PATCH] Update generic_utils.py 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