Skip to content

Commit af2bbf2

Browse files
committed
Fix linting errors in doc folder
1 parent 4c1f245 commit af2bbf2

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

doc/source/conf.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
# full list see the documentation:
1010
# http://www.sphinx-doc.org/en/master/config
1111

12+
import importlib.util
1213
import os
1314
import sys
1415
from datetime import datetime
16+
from importlib.metadata import version as get_version
1517

1618
import jsonschema2md
1719

18-
import fusesoc
1920
from fusesoc.capi2.json_schema import capi2_schema
2021
from fusesoc.utils import yaml_read
2122

@@ -34,8 +35,6 @@
3435
copyright = f"2018-{datetime.now().year}, Olof Kindgren"
3536
author = "Olof Kindgren"
3637

37-
from importlib.metadata import version as get_version
38-
3938
# The full version, including alpha/beta/rc tags.
4039
release: str = get_version("fusesoc")
4140

@@ -109,11 +108,9 @@
109108
# or
110109
# - apt-get install python-sphinx-rtd-theme
111110

112-
try:
113-
import sphinx_rtd_theme
114-
111+
if importlib.util.find_spec("sphinx_rtd_theme") is not None:
115112
html_theme = "sphinx_rtd_theme"
116-
except ImportError:
113+
else:
117114
sys.stderr.write(
118115
"Warning: The Sphinx 'sphinx_rtd_theme' HTML theme was "
119116
+ "not found. Make sure you have the theme installed to produce pretty "

0 commit comments

Comments
 (0)