Skip to content

Commit c014b22

Browse files
authored
Remove unused internal code (#5041)
1 parent 0dae20b commit c014b22

File tree

3 files changed

+0
-24
lines changed

3 files changed

+0
-24
lines changed

src/black/mode.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,6 @@ class Preview(Enum):
240240
}
241241

242242

243-
class Deprecated(UserWarning):
244-
"""Visible deprecation warning."""
245-
246-
247243
_MAX_CACHE_KEY_PART_LENGTH: Final = 32
248244

249245

src/black/nodes.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -842,10 +842,6 @@ def is_parent_function_or_class(node: Node) -> bool:
842842
return node.parent.type in {syms.funcdef, syms.classdef}
843843

844844

845-
def is_function_or_class(node: Node) -> bool:
846-
return node.type in {syms.funcdef, syms.classdef, syms.async_funcdef}
847-
848-
849845
def is_stub_suite(node: Node) -> bool:
850846
"""Return True if `node` is a suite with a stub body."""
851847
if node.parent is not None and not is_parent_function_or_class(node):

src/black/parsing.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -102,22 +102,6 @@ def lib2to3_parse(
102102
return result
103103

104104

105-
def matches_grammar(src_txt: str, grammar: Grammar) -> bool:
106-
drv = driver.Driver(grammar)
107-
try:
108-
drv.parse_string(src_txt, False)
109-
except (ParseError, TokenError, IndentationError):
110-
return False
111-
else:
112-
return True
113-
114-
115-
def lib2to3_unparse(node: Node) -> str:
116-
"""Given a lib2to3 node, return its string representation."""
117-
code = str(node)
118-
return code
119-
120-
121105
class ASTSafetyError(Exception):
122106
"""Raised when Black's generated code is not equivalent to the old AST."""
123107

0 commit comments

Comments
 (0)