Skip to content

Commit 96ae258

Browse files
committed
Add ModuleNotFoundError, use logging.warning (warn is depricated)
1 parent 1e3c8a0 commit 96ae258

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

doc/source/conf.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,14 @@
7979

8080
try:
8181
import sphinxcontrib.spelling # noqa
82-
except ImportError as err:
83-
logger.warn(('sphinxcontrib.spelling failed to import with error "{}". '
84-
'`spellcheck` command is not available.'.format(err)))
82+
except (ImportError, ModuleNotFoundError) as err:
83+
logger.warning(('sphinxcontrib.spelling failed to import with error "{}". '
84+
'`spellcheck` command is not available.'.format(err)))
8585
else:
8686
extensions.append('sphinxcontrib.spelling')
8787

8888
exclude_patterns = ['**.ipynb_checkpoints']
8989

90-
# Tries to import sphixcontrib.spelling - if not available pass
91-
try:
92-
import sphinxcontrib.spelling
93-
extensions.append('sphinxcontrib.spelling')
94-
spelling_word_list_filename = ['spelling_wordlist.txt', 'names_wordlist.txt']
95-
spelling_ignore_pypi_package_names = True
96-
except ModuleNotFoundError:
97-
pass
9890

9991
with open("index.rst") as f:
10092
index_rst_lines = f.readlines()

0 commit comments

Comments
 (0)