aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/importlib/test/benchmark.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-05-11 12:58:42 -0400
committerBrett Cannon <brett@python.org>2012-05-11 12:58:42 -0400
commitcb66eb0deca1d5cd232f97c76a215ecaab958d30 (patch)
treef38497a2e61cf8be225c4e7394961703cea5f66c /Lib/importlib/test/benchmark.py
parent810c64df8f8bf70a2cb7a626004185616cb88213 (diff)
downloadcpython-cb66eb0deca1d5cd232f97c76a215ecaab958d30.tar.gz
cpython-cb66eb0deca1d5cd232f97c76a215ecaab958d30.zip
Issue #13959: Deprecate imp.get_suffixes() for new attributes on
importlib.machinery that provide the suffix details for import. The attributes were not put on imp so as to compartmentalize everything importlib needs for setting up imports in importlib.machinery. This also led to an indirect deprecation of inspect.getmoduleinfo() as it directly returned imp.get_suffix's returned tuple which no longer makes sense.
Diffstat (limited to 'Lib/importlib/test/benchmark.py')
-rw-r--r--Lib/importlib/test/benchmark.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/importlib/test/benchmark.py b/Lib/importlib/test/benchmark.py
index 16863146b5a..183e8180c94 100644
--- a/Lib/importlib/test/benchmark.py
+++ b/Lib/importlib/test/benchmark.py
@@ -9,7 +9,6 @@ from .source import util as source_util
import decimal
import imp
import importlib
-import importlib._bootstrap
import importlib.machinery
import json
import os
@@ -72,7 +71,7 @@ def source_wo_bytecode(seconds, repeat):
assert not os.path.exists(imp.cache_from_source(mapping[name]))
sys.meta_path.append(importlib.machinery.PathFinder)
loader = (importlib.machinery.SourceFileLoader,
- importlib._bootstrap._SOURCE_SUFFIXES, True)
+ importlib.machinery.SOURCE_SUFFIXES, True)
sys.path_hooks.append(importlib.machinery.FileFinder.path_hook(loader))
for result in bench(name, lambda: sys.modules.pop(name), repeat=repeat,
seconds=seconds):
@@ -110,7 +109,7 @@ def source_writing_bytecode(seconds, repeat):
with source_util.create_modules(name) as mapping:
sys.meta_path.append(importlib.machinery.PathFinder)
loader = (importlib.machinery.SourceFileLoader,
- importlib._bootstrap._SOURCE_SUFFIXES, True)
+ importlib.machinery.SOURCE_SUFFIXES, True)
sys.path_hooks.append(importlib.machinery.FileFinder.path_hook(loader))
def cleanup():
sys.modules.pop(name)
@@ -145,7 +144,7 @@ def source_using_bytecode(seconds, repeat):
with source_util.create_modules(name) as mapping:
sys.meta_path.append(importlib.machinery.PathFinder)
loader = (importlib.machinery.SourceFileLoader,
- importlib._bootstrap._SOURCE_SUFFIXES, True)
+ importlib.machinery.SOURCE_SUFFIXES, True)
sys.path_hooks.append(importlib.machinery.FileFinder.path_hook(loader))
py_compile.compile(mapping[name])
assert os.path.exists(imp.cache_from_source(mapping[name]))