Skip to content

Commit eb08110

Browse files
authored
MAINT: Replace NameConstant with Constant (#524)
1 parent 2431739 commit eb08110

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

numpydoc/tests/test_validate.py

-1
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,6 @@ def test_bad_generic_functions(self, capsys, func):
13481348
assert isinstance(errors, list)
13491349
assert errors
13501350

1351-
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
13521351
@pytest.mark.parametrize(
13531352
"klass,func,msgs",
13541353
[

numpydoc/validate.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,9 @@ def get_returns_not_on_nested_functions(node):
521521
if tree:
522522
returns = get_returns_not_on_nested_functions(tree[0])
523523
return_values = [r.value for r in returns]
524-
# Replace NameConstant nodes valued None for None.
524+
# Replace Constant nodes valued None for None.
525525
for i, v in enumerate(return_values):
526-
if isinstance(v, ast.NameConstant) and v.value is None:
526+
if isinstance(v, ast.Constant) and v.value is None:
527527
return_values[i] = None
528528
return any(return_values)
529529
else:

0 commit comments

Comments
 (0)