Skip to content

Commit

Permalink
Avoid iterating bytes children only to find out that they're a series…
Browse files Browse the repository at this point in the history
… of integers.
  • Loading branch information
Majsvaffla committed Aug 28, 2024
1 parent 55bc1ba commit 16bc145
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion htpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def _iter_node_context(x: Node, context_dict: dict[Context[t.Any], t.Any]) -> It
yield str(_escape(x))
elif isinstance(x, int):
yield str(x)
elif isinstance(x, Iterable): # pyright: ignore [reportUnnecessaryIsInstance]
elif isinstance(x, Iterable) and not isinstance(x, bytes): # pyright: ignore [reportUnnecessaryIsInstance]
for child in x:
yield from _iter_node_context(child, context_dict)
else:
Expand Down

0 comments on commit 16bc145

Please sign in to comment.