From: Brett Cannon Date: Sat, 10 May 2008 02:54:52 +0000 (+0000) Subject: Suppress deprecations for packages as well when using X-Git-Tag: v2.6b1~540 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=edb628f24132a8f63c94effa09a537e30f3b55f5;p=python Suppress deprecations for packages as well when using test.test_support.import_module(). --- diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 9a45fdde8d..c612c41f72 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -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: