@@ -44,10 +44,12 @@ def visit_Subscript(self, node: ast.Subscript) -> None:
44
44
class OldSyntaxFinder (ast .NodeVisitor ):
45
45
def visit_AnnAssign (self , node : ast .AnnAssign ) -> None :
46
46
AnnotationUnionFinder ().visit (node .annotation )
47
+ self .generic_visit (node )
47
48
48
49
def visit_arg (self , node : ast .arg ) -> None :
49
50
if node .annotation is not None :
50
51
AnnotationUnionFinder ().visit (node .annotation )
52
+ self .generic_visit (node )
51
53
52
54
def _visit_function (self , node : ast .FunctionDef | ast .AsyncFunctionDef ) -> None :
53
55
if node .returns is not None :
@@ -62,10 +64,12 @@ def visit_AsyncFunctionDef(self, node: ast.AsyncFunctionDef) -> None:
62
64
63
65
def visit_Assign (self , node : ast .Assign ) -> None :
64
66
NonAnnotationUnionFinder ().visit (node .value )
67
+ self .generic_visit (node )
65
68
66
69
def visit_ClassDef (self , node : ast .ClassDef ) -> None :
67
70
for base in node .bases :
68
71
NonAnnotationUnionFinder ().visit (base )
72
+ self .generic_visit (node )
69
73
70
74
class ObjectClassdefFinder (ast .NodeVisitor ):
71
75
def visit_ClassDef (self , node : ast .ClassDef ) -> None :
@@ -80,10 +84,12 @@ class TextFinder(ast.NodeVisitor):
80
84
def visit_ImportFrom (self , node : ast .ImportFrom ) -> None :
81
85
if node .module == "typing" and any (thing .name == "Text" for thing in node .names ):
82
86
errors .append (f"{ path } :{ node .lineno } : Use `str` instead of `typing.Text` in a Python-3-only stub." )
87
+ self .generic_visit (node )
83
88
84
89
def visit_Attribute (self , node : ast .Attribute ) -> None :
85
90
if isinstance (node .value , ast .Name ) and node .value .id == "typing" and node .attr == "Text" :
86
91
errors .append (f"{ path } :{ node .lineno } : Use `str` instead of `typing.Text` in a Python-3-only stub." )
92
+ self .generic_visit (node )
87
93
88
94
class IfFinder (ast .NodeVisitor ):
89
95
def visit_If (self , node : ast .If ) -> None :
0 commit comments