Move some tests a bit around.

This commit is contained in:
Dave Halter
2017-07-30 14:21:42 +02:00
parent d7b7548f8d
commit cc24ba61ef
2 changed files with 29 additions and 6 deletions

View File

@@ -168,6 +168,10 @@ class Context(object):
if name.is_definition():
if parent.type == 'expr_stmt' \
and parent.children[1].type == 'annassign':
if found_global_or_nonlocal:
# If it's after the global the error seems to be
# placed there.
base_name = name
raise_("annotated name '%s' can't be %s")
break
else: