Skip to content

Commit

Permalink
MAINT: Replace NameConstant with Constant (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Jan 9, 2024
1 parent 2431739 commit eb08110
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion numpydoc/tests/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,6 @@ def test_bad_generic_functions(self, capsys, func):
assert isinstance(errors, list)
assert errors

@pytest.mark.filterwarnings("ignore::DeprecationWarning")
@pytest.mark.parametrize(
"klass,func,msgs",
[
Expand Down
4 changes: 2 additions & 2 deletions numpydoc/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,9 @@ def get_returns_not_on_nested_functions(node):
if tree:
returns = get_returns_not_on_nested_functions(tree[0])
return_values = [r.value for r in returns]
# Replace NameConstant nodes valued None for None.
# Replace Constant nodes valued None for None.
for i, v in enumerate(return_values):
if isinstance(v, ast.NameConstant) and v.value is None:
if isinstance(v, ast.Constant) and v.value is None:
return_values[i] = None
return any(return_values)
else:
Expand Down

0 comments on commit eb08110

Please sign in to comment.