diff --git a/Lib/test/output/test_grammar b/Lib/test/output/test_grammar index b75c22f3d5b..a262e794185 100644 --- a/Lib/test/output/test_grammar +++ b/Lib/test/output/test_grammar @@ -36,6 +36,8 @@ continue_stmt return_stmt raise_stmt import_stmt +SyntaxError expected for "def f(): from sys import *" +SyntaxError expected for "def f(): global time; import " global_stmt exec_stmt if_stmt diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 8030e691e19..022398d10a1 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -367,6 +367,8 @@ import time, sys from time import time from sys import * from sys import path, argv +check_syntax("def f(): from sys import *") +check_syntax("def f(): global time; import ") print 'global_stmt' # 'global' NAME (',' NAME)* def f():