cpython: e30196bfc11d (original) (raw)
Mercurial > cpython
changeset 76547:e30196bfc11d
Issue #14605: Revert renaming of _SourcelessFileLoader, since it caused the buildbots to fail. [#14605]
Marc-Andre Lemburg mal@egenix.com | |
---|---|
date | Wed, 25 Apr 2012 02:11:07 +0200 |
parents | 8aa4737d67d2 |
children | a2cf07135e4f |
files | Doc/library/importlib.rst Lib/imp.py Lib/importlib/_bootstrap.py Lib/importlib/abc.py Lib/importlib/machinery.py Lib/importlib/test/source/test_case_sensitivity.py Lib/importlib/test/source/test_file_loader.py Lib/importlib/test/source/test_finder.py Lib/importlib/test/test_abc.py Misc/NEWS |
diffstat | 10 files changed, 18 insertions(+), 15 deletions(-)[+] [-] Doc/library/importlib.rst 13 Lib/imp.py 2 Lib/importlib/_bootstrap.py 4 Lib/importlib/abc.py 2 Lib/importlib/machinery.py 2 Lib/importlib/test/source/test_case_sensitivity.py 2 Lib/importlib/test/source/test_file_loader.py 2 Lib/importlib/test/source/test_finder.py 2 Lib/importlib/test/test_abc.py 2 Misc/NEWS 2 |
line wrap: on
line diff
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -606,15 +606,18 @@ find and load modules.
Load the specified module if it is the same as :attr:name
.
-.. class:: SourcelessFileLoader(fullname, path)
+.. class:: _SourcelessFileLoader(fullname, path)
A concrete implementation of :class:importlib.abc.FileLoader
which can
import bytecode files (i.e. no source code files exist).
- Please note that direct use of bytecode files (and thus not source code
- files) inhibits your modules from being usable by all Python
- implementations or new versions of Python which change the bytecode
- format.
- It is strongly suggested you do not rely on this loader (hence the
- leading underscore of the class). Direct use of bytecode files (and thus not
- source code files) inhibits your modules from being usable by all Python
- implementations. It also runs the risk of your bytecode files not being
- usable by new versions of Python which change the bytecode format. This
- class is only documented as it is directly used by import and thus can
- potentially have instances show up as a module's
__loader__
attribute. .. versionadded:: 3.3
--- a/Lib/imp.py +++ b/Lib/imp.py @@ -94,7 +94,7 @@ def load_source(name, pathname, file=Non class _LoadCompiledCompatibility(_HackedGetData,
_bootstrap.SourcelessFileLoader):[](#l2.7)
_bootstrap._SourcelessFileLoader):[](#l2.8)
"""Compatibility support for implementing load_compiled()."""
--- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -671,7 +671,7 @@ class SourceFileLoader(FileLoader, Sourc pass -class SourcelessFileLoader(FileLoader, _LoaderBasics): +class _SourcelessFileLoader(FileLoader, _LoaderBasics): """Loader which handles sourceless file imports.""" @@ -1198,7 +1198,7 @@ def _setup(sys_module, _imp_module): supported_loaders = [(ExtensionFileLoader, _suffix_list(3), False), (SourceFileLoader, _suffix_list(1), True),
(SourcelessFileLoader, _suffix_list(2), True)][](#l3.16)
setattr(self_module, '_DEFAULT_PATH_HOOK', FileFinder.path_hook(*supported_loaders))(_SourcelessFileLoader, _suffix_list(2), True)][](#l3.17)
--- a/Lib/importlib/abc.py +++ b/Lib/importlib/abc.py @@ -119,7 +119,7 @@ class FileLoader(_bootstrap.FileLoader, ExecutionLoader ABCs.""" _register(FileLoader, machinery.SourceFileLoader,
machinery.SourcelessFileLoader)[](#l4.7)
machinery._SourcelessFileLoader)[](#l4.8)
class SourceLoader(_bootstrap.SourceLoader, ResourceLoader, ExecutionLoader):
--- a/Lib/importlib/machinery.py +++ b/Lib/importlib/machinery.py @@ -5,5 +5,5 @@ from ._bootstrap import FrozenImporter from ._bootstrap import PathFinder from ._bootstrap import FileFinder from ._bootstrap import SourceFileLoader -from ._bootstrap import SourcelessFileLoader +from ._bootstrap import _SourcelessFileLoader from ._bootstrap import ExtensionFileLoader
--- a/Lib/importlib/test/source/test_case_sensitivity.py +++ b/Lib/importlib/test/source/test_case_sensitivity.py @@ -24,7 +24,7 @@ class CaseSensitivityTest(unittest.TestC (_bootstrap.SourceFileLoader, _bootstrap._suffix_list(imp.PY_SOURCE), True),
(_bootstrap.SourcelessFileLoader,[](#l6.7)
(_bootstrap._SourcelessFileLoader,[](#l6.8) _bootstrap._suffix_list(imp.PY_COMPILED),[](#l6.9) True))[](#l6.10) return finder.find_module(self.name)[](#l6.11)
--- a/Lib/importlib/test/source/test_file_loader.py +++ b/Lib/importlib/test/source/test_file_loader.py @@ -379,7 +379,7 @@ class SourceLoaderBadBytecodeTest(BadByt class SourcelessLoaderBadBytecodeTest(BadBytecodeTest):
def test_empty_file(self): def test(name, mapping, bytecode_path):
--- a/Lib/importlib/test/source/test_finder.py +++ b/Lib/importlib/test/source/test_finder.py @@ -38,7 +38,7 @@ class FinderTests(abc.FinderTests): def import_(self, root, module): loader_details = [(_bootstrap.SourceFileLoader, _bootstrap._suffix_list(imp.PY_SOURCE), True),
(_bootstrap.SourcelessFileLoader,[](#l8.7)
(_bootstrap._SourcelessFileLoader,[](#l8.8) _bootstrap._suffix_list(imp.PY_COMPILED), True)][](#l8.9) finder = _bootstrap.FileFinder(root, *loader_details)[](#l8.10) return finder.find_module(module)[](#l8.11)
--- a/Lib/importlib/test/test_abc.py +++ b/Lib/importlib/test/test_abc.py @@ -62,7 +62,7 @@ class ExecutionLoader(InheritanceTests, class FileLoader(InheritanceTests, unittest.TestCase): superclasses = [abc.ResourceLoader, abc.ExecutionLoader]
class SourceLoader(InheritanceTests, unittest.TestCase):
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -84,7 +84,7 @@ Library which send EOF without trailing \r\n.