Skip to content

Commit

Permalink
Allow FileNotFoundError
Browse files Browse the repository at this point in the history
This happens when we try to use a non-existent git command. It happens
more often on Windows as we try to use more Git commands there.
  • Loading branch information
ajjackson committed Dec 9, 2024
1 parent 377bc55 commit 865a6cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build_utils/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
print(f"Trying {gitcmd} ...", file=sys.stderr)
proc = subprocess.run([gitcmd, "describe", "--tags", "--dirty"],
capture_output=True, check=True, text=True)
except subprocess.CalledProcessError as err:
except (subprocess.CalledProcessError, FileNotFoundError) as err:
print(f"Tried {gitcmd}, returned: {err}", file=sys.stderr)
print(f"Stdout: '{err.stdout.strip()}'", file=sys.stderr)
print(f"Stderr: '{err.stderr.strip()}'", file=sys.stderr)
Expand Down

0 comments on commit 865a6cd

Please sign in to comment.