]> granicus.if.org Git - python/commitdiff
Suppress deprecations for packages as well when using
authorBrett Cannon <bcannon@gmail.com>
Sat, 10 May 2008 02:54:52 +0000 (02:54 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sat, 10 May 2008 02:54:52 +0000 (02:54 +0000)
test.test_support.import_module().

Lib/test/test_support.py

index 9a45fdde8dca7809e0d6998d1851f73830837308..c612c41f7226859257a9114072171f37b6d02e0d 100644 (file)
@@ -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: