File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -68,13 +68,13 @@ def visit_Assign(self, node: ast.Assign):
68
68
69
69
# `f = open(...)`
70
70
if isinstance (node .value , ast .Call ) and (
71
- vartype := self .typed_calls .get (ast .unparse (node .value .func ), None )
71
+ vartype := self .typed_calls .get (ast .unparse (node .value .func ))
72
72
):
73
73
self .variables [node .targets [0 ].id ] = vartype
74
74
75
75
# f = ff (and ff is a variable with known type)
76
76
elif isinstance (node .value , ast .Name ) and (
77
- value := self .variables .get (node .value .id , None )
77
+ value := self .variables .get (node .value .id )
78
78
):
79
79
self .variables [node .targets [0 ].id ] = value
80
80
@@ -85,11 +85,7 @@ def visit_With(self, node: ast.With | ast.AsyncWith):
85
85
if (
86
86
isinstance (item .context_expr , ast .Call )
87
87
and isinstance (item .optional_vars , ast .Name )
88
- and (
89
- vartype := self .typed_calls .get (
90
- ast .unparse (item .context_expr .func ), None
91
- )
92
- )
88
+ and (vartype := self .typed_calls .get (ast .unparse (item .context_expr .func )))
93
89
):
94
90
self .variables [item .optional_vars .id ] = vartype
95
91
You can’t perform that action at this time.
0 commit comments