mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
Return statements should be handled correctly if the return_stmt is only a return without an expression behind it.
This commit is contained in:
@@ -335,7 +335,12 @@ class FunctionExecutionContext(context.TreeContext):
|
||||
if check_yields:
|
||||
types |= set(self._eval_yield(r))
|
||||
else:
|
||||
types |= self.eval_node(r.children[1])
|
||||
try:
|
||||
children = r.children
|
||||
except AttributeError:
|
||||
types.add(compiled.create(self.evaluator, None))
|
||||
else:
|
||||
types |= self.eval_node(children[1])
|
||||
if check is flow_analysis.REACHABLE:
|
||||
debug.dbg('Return reachable: %s', r)
|
||||
break
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
def x():
|
||||
return
|
||||
|
||||
#? None
|
||||
x()
|
||||
|
||||
def array(first_param):
|
||||
#? ['first_param']
|
||||
first_param
|
||||
|
||||
Reference in New Issue
Block a user