Skip to content

Commit

Permalink
git promise type must just continue if we have unicode error
Browse files Browse the repository at this point in the history
closes #99
  • Loading branch information
basvandervlies committed Aug 6, 2024
1 parent 2be0eee commit 284cdb6
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions promise-types/git/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,21 @@ def evaluate_promise(self, promiser: str, attributes: Dict, metadata: Dict):

def _git(self, model: object, args: List[str], cwd: Optional[str] = None) -> str:
self.log_verbose("Run: {cmd}".format(cmd=" ".join(args)))
output = (
subprocess.check_output(
args,
env=self._git_envvars(model),
cwd=cwd,
stderr=subprocess.PIPE,
try:
output = (
subprocess.check_output(
args,
env=self._git_envvars(model),
cwd=cwd,
stderr=subprocess.PIPE,
)
.strip()
.decode("utf-8")
)
.strip()
.decode("utf-8")
)
except UnicodeDecodeError:
output = "Could not decode output, just continue"
pass

output != "" and self.log_verbose(output)
return output

Expand Down

0 comments on commit 284cdb6

Please sign in to comment.