Bump ruff to 0.5.2 (#121946)
This commit is contained in:
parent
6109b9206c
commit
3b95e88ff7
4 changed files with 5 additions and 5 deletions
|
@ -21,7 +21,7 @@ def _has_assignment(module: ast.Module, name: str) -> bool:
|
|||
for item in module.body:
|
||||
if type(item) not in (ast.Assign, ast.AnnAssign, ast.AugAssign):
|
||||
continue
|
||||
if type(item) == ast.Assign:
|
||||
if type(item) is ast.Assign:
|
||||
for target in item.targets:
|
||||
if getattr(target, "id", None) == name:
|
||||
return True
|
||||
|
@ -35,7 +35,7 @@ def _has_function(
|
|||
module: ast.Module, _type: ast.AsyncFunctionDef | ast.FunctionDef, name: str
|
||||
) -> bool:
|
||||
"""Test if the module defines a function."""
|
||||
return any(type(item) == _type and item.name == name for item in module.body)
|
||||
return any(type(item) is _type and item.name == name for item in module.body)
|
||||
|
||||
|
||||
def _has_import(module: ast.Module, name: str) -> bool:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue