]> granicus.if.org Git - python/commitdiff
add test for illegal imports
authorJeremy Hylton <jeremy@alum.mit.edu>
Tue, 30 Jan 2001 01:25:56 +0000 (01:25 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Tue, 30 Jan 2001 01:25:56 +0000 (01:25 +0000)
Lib/test/output/test_grammar
Lib/test/test_grammar.py

index b75c22f3d5b4da93c31ce024763a31796ba1692d..a262e794185b444038a674a460fe702fb18c661e 100644 (file)
@@ -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
index 8030e691e19f63cd39cf2784016718371bd16287..022398d10a1e4caa3fb39c5a1555153fdd19f21d 100644 (file)
@@ -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():