mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
silence warnings about import *
This commit is contained in:
parent
c4dcb63019
commit
cd738364ce
1 changed files with 7 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
||||||
from test.test_support import verify, TestFailed, check_syntax
|
from test.test_support import verify, TestFailed, check_syntax
|
||||||
|
|
||||||
|
import warnings
|
||||||
|
warnings.filterwarnings("ignore", "import *")
|
||||||
|
|
||||||
print "1. simple nesting"
|
print "1. simple nesting"
|
||||||
|
|
||||||
def make_adder(x):
|
def make_adder(x):
|
||||||
|
@ -227,6 +230,7 @@ def f():
|
||||||
|
|
||||||
# and verify a few cases that should work
|
# and verify a few cases that should work
|
||||||
|
|
||||||
|
exec """
|
||||||
def noproblem1():
|
def noproblem1():
|
||||||
from string import *
|
from string import *
|
||||||
f = lambda x:x
|
f = lambda x:x
|
||||||
|
@ -241,6 +245,7 @@ def noproblem3():
|
||||||
def f(x):
|
def f(x):
|
||||||
global y
|
global y
|
||||||
y = x
|
y = x
|
||||||
|
"""
|
||||||
|
|
||||||
print "12. lambdas"
|
print "12. lambdas"
|
||||||
|
|
||||||
|
@ -478,3 +483,5 @@ except TypeError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
print "eval() should have failed, because code contained free vars"
|
print "eval() should have failed, because code contained free vars"
|
||||||
|
|
||||||
|
warnings.resetwarnings()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue