Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint error #2010

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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