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.
This commit is contained in:
Antoine Pitrou 2012-02-20 01:48:16 +01:00
parent 336b2f45e5
commit c541f8ef40
7 changed files with 90 additions and 50 deletions

View file

@ -6,6 +6,7 @@
import sys
import os
import shutil
import importlib
import unittest
from test.support import run_unittest, create_empty_file
@ -212,6 +213,7 @@ class LongReprTest(unittest.TestCase):
# Remember where we are
self.here = os.getcwd()
sys.path.insert(0, self.here)
importlib.invalidate_caches()
def tearDown(self):
actions = []