We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50b5618 commit 020870fCopy full SHA for 020870f
setuptools_git_versioning/git.py
@@ -19,6 +19,11 @@ def _exec(*cmd: str, root: str | os.PathLike | None = None) -> list[str]:
19
stdout = subprocess.check_output(cmd, text=True, cwd=root) # noqa: S603
20
except subprocess.CalledProcessError as e:
21
stdout = e.output
22
+ except (FileNotFoundError, OSError) as e:
23
+ # Handle case where git executable is not found
24
+ # FileNotFoundError on Unix, OSError on some other systems
25
+ log.log(DEBUG, "Command not found: %r", e)
26
+ stdout = ""
27
lines = stdout.splitlines()
28
return [line.rstrip() for line in lines if line.rstrip()]
29
0 commit comments