mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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:
parent
336b2f45e5
commit
c541f8ef40
7 changed files with 90 additions and 50 deletions
|
@ -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 = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue