summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/importlib/_bootstrap.py4
-rw-r--r--Lib/test/test_importlib/source/test_abc_loader.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index 2e0bd6a..0c6252e 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -931,7 +931,7 @@ class SourceLoader(_LoaderBasics):
raise ImportError("Failed to decode source file",
name=fullname) from exc
- def compile_source(self, data, path):
+ def source_to_code(self, data, path):
"""Return the code object compiled from source.
The 'data' argument can be any object type that compile() supports.
@@ -984,7 +984,7 @@ class SourceLoader(_LoaderBasics):
raise ImportError(msg.format(bytecode_path),
name=fullname, path=bytecode_path)
source_bytes = self.get_data(source_path)
- code_object = self.compile_source(source_bytes, source_path)
+ code_object = self.source_to_code(source_bytes, source_path)
_verbose_message('code object from {}', source_path)
if (not sys.dont_write_bytecode and bytecode_path is not None and
source_mtime is not None):
diff --git a/Lib/test/test_importlib/source/test_abc_loader.py b/Lib/test/test_importlib/source/test_abc_loader.py
index 44bec32..cce7b07 100644
--- a/Lib/test/test_importlib/source/test_abc_loader.py
+++ b/Lib/test/test_importlib/source/test_abc_loader.py
@@ -148,9 +148,9 @@ class SourceOnlyLoaderTests(SourceLoaderTestHarness):
code_object = self.loader.get_code(self.name)
self.verify_code(code_object)
- def test_compile_source(self):
+ def test_source_to_code(self):
# Verify the compiled code object.
- code = self.loader.compile_source(self.loader.source, self.path)
+ code = self.loader.source_to_code(self.loader.source, self.path)
self.verify_code(code)
def test_load_module(self):