Skip to content

Commit 96c16bf

Browse files
authored
Merge pull request #153 from akhmerov/issue-139
use nbclient for execution if possible
2 parents b760f40 + 071f645 commit 96c16bf

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)