empty asserts should not lead to broken parsers

This commit is contained in:
David Halter
2013-08-17 23:04:01 +04:30
parent af7089b8ca
commit 230bf724a2
2 changed files with 8 additions and 2 deletions

View File

@@ -665,7 +665,7 @@ class Parser(object):
stmt, tok = self._parse_statement()
if stmt is not None:
stmt.parent = use_as_parent_scope
self._scope.asserts.append(stmt)
self._scope.asserts.append(stmt)
# default
elif token_type in [tokenize.NAME, tokenize.STRING,
tokenize.NUMBER] \

View File

@@ -141,10 +141,16 @@ a[0]
int()).
# -----------------
# goto
# keywords
# -----------------
#! []
as
def empty_assert():
x = 3
assert
#? int()
x
import datetime as