Skip to content

Commit 0615526

Browse files
authored
deprecated ast attribute (ipython#14575)
2 parents a7baa22 + 806dba2 commit 0615526

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

IPython/core/tests/test_interactiveshell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ class Negator(ast.NodeTransformer):
721721
"""Negates all number literals in an AST."""
722722

723723
def visit_Num(self, node):
724-
node.n = -node.n
724+
node.value = -node.value
725725
return node
726726

727727
def visit_Constant(self, node):

docs/source/config/inputtransforms.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ mathematical frameworks that want to handle e.g. ``1/3`` as a precise fraction::
8484
class IntegerWrapper(ast.NodeTransformer):
8585
"""Wraps all integers in a call to Integer()"""
8686
def visit_Num(self, node):
87-
if isinstance(node.n, int):
87+
if isinstance(node.value, int):
8888
return ast.Call(func=ast.Name(id='Integer', ctx=ast.Load()),
8989
args=[node], keywords=[])
9090
return node

0 commit comments

Comments
 (0)