add test for illegal imports

This commit is contained in:
Jeremy Hylton 2001-01-30 01:25:56 +00:00
parent 10f8ba4fc6
commit ac25a38841
2 changed files with 4 additions and 0 deletions

View 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

View 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():