mirror of
https://github.com/python/cpython
synced 2026-09-29 10:30:29 +03:00
add test for illegal imports
This commit is contained in:
parent
10f8ba4fc6
commit
ac25a38841
2 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue