sco1/flake8-annotations

`ast.NameCostant` Deprecation in Python 3.14

Closed this issue · 0 comments

sco1 commented

Starting with py3.13 we're getting the following warning emitted:

DeprecationWarning: ast.NameConstant is deprecated and will be removed in Python 3.14; use ast.Constant instead

Which is used here:

if node.value is not None:
# In the event of an explicit `None` return (`return None`), the node body will be an
# instance of either `ast.Constant` (3.8+) or `ast.NameConstant`, which we need to check
# to see if it's actually `None`
if isinstance(node.value, (ast.Constant, ast.NameConstant)): # pragma: no branch
if node.value.value is None:
return

Judging from the note from past me I think this can already be dropped since py3.7 support has been removed.