Skip to content

Commit

Permalink
Fix lint error (#2010)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Jun 22, 2023
1 parent 11c3caf commit b75c368
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nbconvert/exporters/templateexporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def _init_preprocessors(self):
# * We rely on recursive_update, which can only merge dicts, lists will be overwritten
# * We can use the key with numerical prefixing to guarantee ordering (/etc/*.d/XY-file style)
# * We can disable preprocessors by overwriting the value with None
for _, preprocessor in sorted(preprocessors.items(), key=lambda x: x[0]): # type:ignore
for _, preprocessor in sorted(preprocessors.items(), key=lambda x: x[0]):
if preprocessor is not None:
kwargs = preprocessor.copy()
preprocessor_cls = kwargs.pop("type")
Expand Down
4 changes: 1 addition & 3 deletions nbconvert/filters/tests/test_highlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ def test_inject_html(self):
assert "<script>alert(1)</script>" not in out

def _extract_tokens(self, root, cls):
return set( # noqa
map(lambda x: x.text, root.findall(".//*[@class='" + cls + "']")) # type:ignore
)
return set(map(lambda x: x.text, root.findall(".//*[@class='" + cls + "']"))) # noqa

def _try_highlight(self, method, test, tokens):
"""Try highlighting source, look for key tokens"""
Expand Down

0 comments on commit b75c368

Please sign in to comment.