1
0
forked from VimPlug/jedi

A simple yield should not cause an error, fixes #1117

This commit is contained in:
Dave Halter
2018-05-23 09:56:40 +02:00
parent d10eff5625
commit 50812b5836
2 changed files with 13 additions and 1 deletions

View File

@@ -205,9 +205,13 @@ def eval_atom(context, atom):
# For False/True/None
if atom.value in ('False', 'True', 'None'):
return ContextSet(compiled.builtin_from_name(context.evaluator, atom.value))
if atom.value == 'print':
elif atom.value == 'print':
# print e.g. could be evaluated like this in Python 2.7
return NO_CONTEXTS
elif atom.value == 'yield':
# Contrary to yield from, yield can just appear alone to return a
# value when used with `.send()`.
return NO_CONTEXTS
assert False, 'Cannot evaluate the keyword %s' % atom
elif isinstance(atom, tree.Literal):