From: Brett Cannon Date: Sun, 30 Aug 2009 18:59:21 +0000 (+0000) Subject: Fix the importlib_only test decorator to work again; don't capture the flag variable... X-Git-Tag: v3.2a1~2648 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44b28a9f328f5688ceb774670a6db030fa54d5a3;p=python Fix the importlib_only test decorator to work again; don't capture the flag variable as it might change later. --- diff --git a/Lib/importlib/test/import_/util.py b/Lib/importlib/test/import_/util.py index 6b0e9d1046..649c5ed27c 100644 --- a/Lib/importlib/test/import_/util.py +++ b/Lib/importlib/test/import_/util.py @@ -15,7 +15,9 @@ def import_(*args, **kwargs): return importlib.__import__(*args, **kwargs) -importlib_only = unittest.skipIf(using___import__, "importlib-specific test") +def importlib_only(fxn): + """Decorator to skip a test if using __builtins__.__import__.""" + return unittest.skipIf(using___import__, "importlib-specific test")(fxn) def mock_path_hook(*entries, importer):