Skip to content
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
4 changes: 0 additions & 4 deletions src/black/mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,6 @@ class Preview(Enum):
}


class Deprecated(UserWarning):
"""Visible deprecation warning."""


_MAX_CACHE_KEY_PART_LENGTH: Final = 32


Expand Down
4 changes: 0 additions & 4 deletions src/black/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,10 +842,6 @@ def is_parent_function_or_class(node: Node) -> bool:
return node.parent.type in {syms.funcdef, syms.classdef}


def is_function_or_class(node: Node) -> bool:
return node.type in {syms.funcdef, syms.classdef, syms.async_funcdef}


def is_stub_suite(node: Node) -> bool:
"""Return True if `node` is a suite with a stub body."""
if node.parent is not None and not is_parent_function_or_class(node):
Expand Down
16 changes: 0 additions & 16 deletions src/black/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,6 @@ def lib2to3_parse(
return result


def matches_grammar(src_txt: str, grammar: Grammar) -> bool:
drv = driver.Driver(grammar)
try:
drv.parse_string(src_txt, False)
except (ParseError, TokenError, IndentationError):
return False
else:
return True


def lib2to3_unparse(node: Node) -> str:
"""Given a lib2to3 node, return its string representation."""
code = str(node)
return code


class ASTSafetyError(Exception):
"""Raised when Black's generated code is not equivalent to the old AST."""

Expand Down
Loading