blob: 17e237b8c14341d105f56f326847e8c3c7f9664a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
# test errors with import *
# 'import *' is not allowed in function scope
try:
exec('def foo(): from x import *')
except SyntaxError as er:
print('function', 'SyntaxError')
# 'import *' is not allowed in class scope
try:
exec('class C: from x import *')
except SyntaxError as er:
print('class', 'SyntaxError')
|