Skip to content

Commit 17a2b17

Browse files
committed
Add import git to try/except
1 parent e17ec14 commit 17a2b17

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

doc/make.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import webbrowser
2222
import jinja2
2323

24-
from scripts.announce import update_name_wordlist
2524

2625

2726
DOC_PATH = os.path.dirname(os.path.abspath(__file__))
@@ -309,7 +308,11 @@ def zip_html(self):
309308

310309
def spellcheck(self):
311310
"""Spell check the documentation."""
312-
update_name_wordlist()
311+
try:
312+
from scripts.announce import update_name_wordlist
313+
update_name_wordlist()
314+
except (ImportError, ModuleNotFoundError):
315+
print("Unable to update name wordlist, run python script/announce.py to update the list.")
313316
self._sphinx_build('spelling')
314317
output_location = os.path.join('build', 'spelling', 'output.txt')
315318
with open(output_location) as output:

doc/source/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@
7979

8080
try:
8181
import sphinxcontrib.spelling # noqa
82-
except ImportError as err:
82+
import git
83+
except (ImportError, ModuleNotFoundError) as err:
8384
logger.warning(('sphinxcontrib.spelling failed to import with error "{}". '
8485
'`spellcheck` command is not available.'.format(err)))
8586
else:

0 commit comments

Comments
 (0)