Skip to content

Commit

Permalink
Import import_object from non-public module
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Dec 24, 2024
1 parent 40d8cd4 commit 1a5159e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/nbsphinx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
except ImportError:
# This will be removed in Sphinx 8:
from sphinx.util import status_iterator
try:
from sphinx.util._importer import import_object
except ImportError:
# This will hopefully be un-deprecated, see
# https://github.com/sphinx-doc/sphinx/issues/13083
from sphinx.util import import_object
import traitlets


Expand Down Expand Up @@ -594,7 +600,7 @@ def parse(self, inputstring, document):
else:
kwargs = {}
if isinstance(converter, str):
converter = sphinx.util.import_object(converter)
converter = import_object(converter)
try:
nb = converter(inputstring, **kwargs)
except Exception:
Expand Down

0 comments on commit 1a5159e

Please sign in to comment.