mirror of
https://github.com/python/cpython.git
synced 2025-07-30 14:44:10 +00:00
Suppress deprecations for packages as well when using
test.test_support.import_module().
This commit is contained in:
parent
cda73a4b4e
commit
edb628f241
1 changed files with 2 additions and 1 deletions
|
@ -42,7 +42,8 @@ def import_module(name, deprecated=False):
|
|||
available."""
|
||||
with catch_warning(record=False):
|
||||
if deprecated:
|
||||
warnings.filterwarnings("ignore", ".+ module", DeprecationWarning)
|
||||
warnings.filterwarnings("ignore", ".+ (module|package)",
|
||||
DeprecationWarning)
|
||||
try:
|
||||
module = __import__(name, level=0)
|
||||
except ImportError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue