Commit f732504 1 parent 515c9db commit f732504 Copy full SHA for f732504
File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,11 @@ def create_nb_reader(
57
57
:returns: the notebook reader, and the (potentially modified) MdParserConfig,
58
58
or None if the input cannot be read as a notebook.
59
59
"""
60
- # the import is here so this module can be loaded without sphinx
61
- from importlib import import_module
60
+
61
+ try :
62
+ from sphinx .util ._importer import import_object
63
+ except ImportError :
64
+ from sphinx .util import import_object
62
65
63
66
# get all possible readers
64
67
readers = nb_config .custom_formats .copy ()
@@ -71,7 +74,7 @@ def create_nb_reader(
71
74
if str (Path (path )).endswith (suffix ):
72
75
if isinstance (reader , str ):
73
76
# attempt to load the reader as an object path
74
- reader = import_module (reader )
77
+ reader = import_object (reader )
75
78
if commonmark_only :
76
79
# Markdown cells should be read as Markdown only
77
80
md_config = dc .replace (md_config , commonmark_only = True )
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ show_error_codes = true
131
131
check_untyped_defs = true
132
132
strict_equality = true
133
133
no_implicit_optional = true
134
+ ignore_missing_imports = true
134
135
warn_unused_ignores = true
135
136
136
137
[[tool .mypy .overrides ]]
You can’t perform that action at this time.
0 commit comments