mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30: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
|
|
@ -18,7 +18,7 @@ References on import:
|
|||
http://www.python.org/dev/peps/pep-0328
|
||||
|
||||
"""
|
||||
__all__ = ['__import__', 'import_module']
|
||||
__all__ = ['__import__', 'import_module', 'invalidate_caches']
|
||||
|
||||
from . import _bootstrap
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ _bootstrap._setup(sys, imp)
|
|||
|
||||
# Public API #########################################################
|
||||
|
||||
from ._bootstrap import __import__
|
||||
from ._bootstrap import __import__, invalidate_caches
|
||||
|
||||
|
||||
def import_module(name, package=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue