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):
6868
6969 # `f = open(...)`
7070 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 ))
7272 ):
7373 self .variables [node .targets [0 ].id ] = vartype
7474
7575 # f = ff (and ff is a variable with known type)
7676 elif isinstance (node .value , ast .Name ) and (
77- value := self .variables .get (node .value .id , None )
77+ value := self .variables .get (node .value .id )
7878 ):
7979 self .variables [node .targets [0 ].id ] = value
8080
@@ -85,11 +85,7 @@ def visit_With(self, node: ast.With | ast.AsyncWith):
8585 if (
8686 isinstance (item .context_expr , ast .Call )
8787 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 )))
9389 ):
9490 self .variables [item .optional_vars .id ] = vartype
9591
You can’t perform that action at this time.
0 commit comments