]> granicus.if.org Git - python/commitdiff
Issue #15627: This is simply an update to the name of a new method recently added
authorEric Snow <ericsnowcurrently@gmail.com>
Wed, 5 Dec 2012 07:43:43 +0000 (23:43 -0800)
committerEric Snow <ericsnowcurrently@gmail.com>
Wed, 5 Dec 2012 07:43:43 +0000 (23:43 -0800)
to importlib.abc.SourceLoader.

Doc/library/importlib.rst
Lib/importlib/_bootstrap.py
Lib/test/test_importlib/source/test_abc_loader.py
Misc/NEWS
Python/importlib.h

index 6c9c6b366c777a3028620f70360d15bec1088e3c..ee9045b446d0eedb19604bfeb8ce4643dabc7bc7 100644 (file)
@@ -409,7 +409,7 @@ ABC hierarchy::
         When writing to the path fails because the path is read-only
         (:attr:`errno.EACCES`), do not propagate the exception.
 
-    .. method:: compile_source(data, path)
+    .. method:: source_to_code(data, path)
 
         Create a code object from Python source.
 
index 2e0bd6a4779bb5f10ac7fc3d8e3908143996de1d..0c6252ebd63b4b32617447d1c1bf1855bcbd8d1a 100644 (file)
@@ -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):
index 44bec328b090584503d61a828b6a5df290f9af67..cce7b07098fdf3deecc87cc0175be5bf1b243ed1 100644 (file)
@@ -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):
index 77c726b0d4554422913fcdc8c3a02c2d1a14990e..6f7308497d60fb959e6992bb2040607001c30b34 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -190,7 +190,7 @@ Library
 
 - Issue #16522: added FAIL_FAST flag to doctest.
 
-- Issue #15627: Add the importlib.abc.SourceLoader.compile_source() method.
+- Issue #15627: Add the importlib.abc.SourceLoader.source_to_code() method.
 
 - Issue #16408: Fix file descriptors not being closed in error conditions
   in the zipfile module.  Patch by Serhiy Storchaka.
index 3c0015ba6624cd6b905e2a707f869902fb007a7b..ea7186351391ca7938b696f7a7f6ce6d363845bd 100644 (file)
@@ -2200,11 +2200,11 @@ unsigned char _Py_M__importlib[] = {
     97,116,97,117,4,0,0,0,112,97,116,104,40,0,0,0,
     0,40,0,0,0,0,117,29,0,0,0,60,102,114,111,122,
     101,110,32,105,109,112,111,114,116,108,105,98,46,95,98,111,
-    111,116,115,116,114,97,112,62,117,14,0,0,0,99,111,109,
-    112,105,108,101,95,115,111,117,114,99,101,166,3,0,0,115,
+    111,116,115,116,114,97,112,62,117,14,0,0,0,115,111,117,
+    114,99,101,95,116,111,95,99,111,100,101,166,3,0,0,115,
     4,0,0,0,0,5,18,1,117,27,0,0,0,83,111,117,
-    114,99,101,76,111,97,100,101,114,46,99,111,109,112,105,108,
-    101,95,115,111,117,114,99,101,99,2,0,0,0,0,0,0,
+    114,99,101,76,111,97,100,101,114,46,115,111,117,114,99,101,
+    95,116,111,95,99,111,100,101,99,2,0,0,0,0,0,0,
     0,12,0,0,0,45,0,0,0,67,0,0,0,115,43,2,
     0,0,124,0,0,106,0,0,124,1,0,131,1,0,125,2,
     0,100,8,0,125,3,0,121,16,0,116,2,0,124,2,0,
@@ -2278,8 +2278,8 @@ unsigned char _Py_M__importlib[] = {
     99,101,117,10,0,0,0,95,99,111,100,101,95,116,121,112,
     101,117,4,0,0,0,95,105,109,112,117,16,0,0,0,95,
     102,105,120,95,99,111,95,102,105,108,101,110,97,109,101,117,
-    6,0,0,0,102,111,114,109,97,116,117,14,0,0,0,99,
-    111,109,112,105,108,101,95,115,111,117,114,99,101,117,3,0,
+    6,0,0,0,102,111,114,109,97,116,117,14,0,0,0,115,
+    111,117,114,99,101,95,116,111,95,99,111,100,101,117,3,0,
     0,0,115,121,115,117,19,0,0,0,100,111,110,116,95,119,
     114,105,116,101,95,98,121,116,101,99,111,100,101,117,9,0,
     0,0,98,121,116,101,97,114,114,97,121,117,12,0,0,0,
@@ -2345,8 +2345,8 @@ unsigned char _Py_M__importlib[] = {
     112,97,116,104,95,115,116,97,116,115,117,15,0,0,0,95,
     99,97,99,104,101,95,98,121,116,101,99,111,100,101,117,8,
     0,0,0,115,101,116,95,100,97,116,97,117,10,0,0,0,
-    103,101,116,95,115,111,117,114,99,101,117,14,0,0,0,99,
-    111,109,112,105,108,101,95,115,111,117,114,99,101,117,8,0,
+    103,101,116,95,115,111,117,114,99,101,117,14,0,0,0,115,
+    111,117,114,99,101,95,116,111,95,99,111,100,101,117,8,0,
     0,0,103,101,116,95,99,111,100,101,117,11,0,0,0,108,
     111,97,100,95,109,111,100,117,108,101,40,1,0,0,0,117,
     10,0,0,0,95,95,108,111,99,97,108,115,95,95,40,0,