Skip to content

Commit

Permalink
Simplify condition
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Dec 29, 2023
1 parent 8ed5e18 commit aa033a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jupyter_sphinx/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ def apply(self):
file_name = next(default_names)

# Save time when jupyter notebook execution is not necessary
if not any(not "execute" in node or node["execute"] for node in nodes):
if all("execute" in node and not node["execute"] for node in nodes):
notebook = blank_nb(kernel_name)
try:
cm_language = notebook.metadata.language_info.codemirror_mode.name
except AttributeError:
cm_language = notebook.metadata.kernelspec.language
# Mimics empty cell output for each node
# Mimic empty cell output for each node
for node in nodes:
source = node.children[0]
source.attributes["classes"].append("code_cell")
Expand Down

0 comments on commit aa033a2

Please sign in to comment.