mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-21 10:17:05 +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:
1 parent
c47f5ca68c
commit
9cac7462d6
2 files changed
+12
-1
No files matched your search
@@ -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