diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-02-20 00:48:16 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-02-20 00:48:16 (GMT) |
commit | c541f8ef40634c379aab0e4537777203a910d355 (patch) | |
tree | 9b731dfbfc79f8c7ae11ec43d7f7914b4d32082b /Lib/importlib/test | |
parent | 336b2f45e5c1212470b1b443a92d953f026b951e (diff) | |
download | cpython-c541f8ef40634c379aab0e4537777203a910d355.zip cpython-c541f8ef40634c379aab0e4537777203a910d355.tar.gz cpython-c541f8ef40634c379aab0e4537777203a910d355.tar.bz2 |
Issue #14043: Speed up importlib's _FileFinder by at least 8x, and add a new importlib.invalidate_caches() function.
importlib is now often faster than imp.find_module() at finding modules.
Diffstat (limited to 'Lib/importlib/test')
-rw-r--r-- | Lib/importlib/test/import_/test_path.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/importlib/test/import_/test_path.py b/Lib/importlib/test/import_/test_path.py index 61fe226..5713319 100644 --- a/Lib/importlib/test/import_/test_path.py +++ b/Lib/importlib/test/import_/test_path.py @@ -78,11 +78,11 @@ class FinderTests(unittest.TestCase): path = '' module = '<test module>' importer = util.mock_modules(module) - hook = import_util.mock_path_hook(os.getcwd(), importer=importer) + hook = import_util.mock_path_hook(os.curdir, importer=importer) with util.import_state(path=[path], path_hooks=[hook]): loader = machinery.PathFinder.find_module(module) self.assertIs(loader, importer) - self.assertIn(os.getcwd(), sys.path_importer_cache) + self.assertIn(os.curdir, sys.path_importer_cache) class DefaultPathFinderTests(unittest.TestCase): |