Skip to content

Commit 2201693

Browse files
blmaierdhellmann
authored andcommitted
gracefully handle if git is not installed
The following error occurs in `_get_contributors()` if git is not installed. > FileNotFoundError: [Errno 2] No such file or directory: 'git': 'git' Treat this the same as if `git` fails, catch the error and print a warning.
1 parent 13ac4cc commit 2201693

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sphinxcontrib/spelling/filters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def _get_contributors(self):
245245

246246
try:
247247
p = subprocess.run(cmd, check=True, stdout=subprocess.PIPE)
248-
except subprocess.CalledProcessError as err:
248+
except (subprocess.CalledProcessError, FileNotFoundError) as err:
249249
logger.warning('Called: %s', ' '.join(cmd))
250250
logger.warning('Failed to scan contributors: %s', err)
251251
return set()

0 commit comments

Comments
 (0)