summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2009-08-30 18:59:21 (GMT)
committerBrett Cannon <bcannon@gmail.com>2009-08-30 18:59:21 (GMT)
commit44b28a9f328f5688ceb774670a6db030fa54d5a3 (patch)
tree8b36b0ed02a42c0ff25e6a55aa28aa7b2d3e067a /Lib/importlib
parenta6503606f9fcd0160d9cba828b9ff98e1a7b5163 (diff)
downloadcpython-44b28a9f328f5688ceb774670a6db030fa54d5a3.zip
cpython-44b28a9f328f5688ceb774670a6db030fa54d5a3.tar.gz
cpython-44b28a9f328f5688ceb774670a6db030fa54d5a3.tar.bz2
Fix the importlib_only test decorator to work again; don't capture the flag variable as it might change later.
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/test/import_/util.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/importlib/test/import_/util.py b/Lib/importlib/test/import_/util.py
index 6b0e9d1..649c5ed 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):