@@ -479,6 +479,7 @@ def visit_expr(self, node, parent):
479
479
newnode .postinit (self .visit (node .value , newnode ))
480
480
return newnode
481
481
482
+ # Not used in Python 3.8+.
482
483
def visit_ellipsis (self , node , parent ):
483
484
"""visit an Ellipsis node by returning a fresh instance of it"""
484
485
return nodes .Ellipsis (getattr (node , 'lineno' , None ),
@@ -509,6 +510,7 @@ def visit_exec(self, node, parent):
509
510
_visit_or_none (node , 'locals' , self , newnode ))
510
511
return newnode
511
512
513
+ # Not used in Python 3.8+.
512
514
def visit_extslice (self , node , parent ):
513
515
"""visit an ExtSlice node by returning a fresh instance of it"""
514
516
newnode = nodes .ExtSlice (parent = parent )
@@ -641,6 +643,7 @@ def visit_import(self, node, parent):
641
643
parent .set_local (name .split ('.' )[0 ], newnode )
642
644
return newnode
643
645
646
+ # Not used in Python 3.8+.
644
647
def visit_index (self , node , parent ):
645
648
"""visit a Index node by returning a fresh instance of it"""
646
649
newnode = nodes .Index (parent = parent )
@@ -702,12 +705,19 @@ def visit_name(self, node, parent):
702
705
self ._save_assignment (newnode )
703
706
return newnode
704
707
708
+ def visit_constant (self , node , parent ):
709
+ """visit a Constant node by returning a fresh instance of Const"""
710
+ return nodes .Const (node .value , getattr (node , 'lineno' , None ),
711
+ getattr (node , 'col_offset' , None ), parent )
712
+
713
+ # Not used in Python 3.8+.
705
714
def visit_str (self , node , parent ):
706
715
"""visit a String/Bytes node by returning a fresh instance of Const"""
707
716
return nodes .Const (node .s , getattr (node , 'lineno' , None ),
708
717
getattr (node , 'col_offset' , None ), parent )
709
718
visit_bytes = visit_str
710
719
720
+ # Not used in Python 3.8+.
711
721
def visit_num (self , node , parent ):
712
722
"""visit a Num node by returning a fresh instance of Const"""
713
723
return nodes .Const (node .n , getattr (node , 'lineno' , None ),
@@ -854,6 +864,7 @@ def visit_arg(self, node, parent):
854
864
"""visit an arg node by returning a fresh AssName instance"""
855
865
return self .visit_assignname (node , parent , node .arg )
856
866
867
+ # Not used in Python 3.8+.
857
868
def visit_nameconstant (self , node , parent ):
858
869
# in Python 3.4 we have NameConstant for True / False / None
859
870
return nodes .Const (node .value , getattr (node , 'lineno' , None ),
0 commit comments