Skip to content

Commit 071f645

Browse files
committed
use nbclient for execution if possible
1 parent b760f40 commit 071f645

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jupyter_sphinx/execute.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@
99
import docutils
1010
from docutils.parsers.rst import Directive, directives
1111

12-
from nbconvert.preprocessors.execute import executenb
12+
import nbconvert
1313
from nbconvert.preprocessors import ExtractOutputPreprocessor
1414
from nbconvert.writers import FilesWriter
1515

16+
if nbconvert.version_info < (6,):
17+
from nbconvert.preprocessors.execute import executenb
18+
else:
19+
from nbclient.client import execute as executenb
1620

1721
import nbformat
1822

0 commit comments

Comments
 (0)