Skip to content

Commit

Permalink
Remove unnecessary and incorrect type EmptyReturn
Browse files Browse the repository at this point in the history
It was a str instead of List[str]
  • Loading branch information
bcaller authored and Ben Caller committed Jul 27, 2018
1 parent 120f5b8 commit 8c24cc8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions pyt/cfg/stmt_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,6 @@ def visit_Return(self, node):
label = LabelVisitor()
label.visit(node)

try:
rhs_visitor = RHSVisitor()
rhs_visitor.visit(node.value)
except AttributeError:
rhs_visitor.result = 'EmptyReturn'

this_function_name = self.function_return_stack[-1]
LHS = 'ret_' + this_function_name

Expand All @@ -263,14 +257,17 @@ def visit_Return(self, node):
path=self.filenames[-1]
)
return_value_of_call.connect(return_node)
self.nodes.append(return_node)
return return_node
return self.append_node(return_node)
elif node.value is not None:
rhs_visitor_result = RHSVisitor.result_for_node(node.value)
else:
rhs_visitor_result = []

return self.append_node(ReturnNode(
LHS + ' = ' + label.result,
LHS,
node,
rhs_visitor.result,
rhs_visitor_result,
path=self.filenames[-1]
))

Expand Down

0 comments on commit 8c24cc8

Please sign in to comment.