Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Jul 5, 2023
1 parent 8c96168 commit 0c8f293
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/black/parsing.py
Expand Up @@ -164,9 +164,13 @@ def _normalize(lineend: str, value: str) -> str:
def stringify_ast(node: ast.AST, depth: int = 0) -> Iterator[str]:
"""Simple visitor generating strings to compare ASTs by content."""

if isinstance(node, ast.Constant) and isinstance(node.value, str) and node.kind == "u":
# It's a quirk of history that we strip the u prefix over here. We used to rewrite
# the AST nodes for Python version compatibility and we never copied over the kind
node.kind = None

yield f"{' ' * depth}{node.__class__.__name__}("

type_ignore_classes: Tuple[Type[Any], ...]
for field in sorted(node._fields): # noqa: F402
# TypeIgnore has only one field 'lineno' which breaks this comparison
if isinstance(node, ast.TypeIgnore):
Expand Down

0 comments on commit 0c8f293

Please sign in to comment.