Updated deprecated ast.NameConstant with ast.Constant #6305 (#6463)

This commit is contained in:
ThunderMind 2024-10-29 14:28:00 +05:00 committed by GitHub
parent fcb5ab6cff
commit 5bbf8124ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

@ -263,9 +263,7 @@ def is_generator_with_return_value(callable: Callable[..., Any]) -> bool:
def returns_none(return_node: ast.Return) -> bool:
value = return_node.value
return (
value is None or isinstance(value, ast.NameConstant) and value.value is None
)
return value is None or isinstance(value, ast.Constant) and value.value is None
if inspect.isgeneratorfunction(callable):
func = callable