Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Lib/importlib/abc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Abstract base classes related to import."""
from . import _bootstrap_external
from . import machinery

try:
import _frozen_importlib
except ImportError as exc:
Expand All @@ -11,10 +12,12 @@
import _frozen_importlib_external
except ImportError:
_frozen_importlib_external = _bootstrap_external
from ._abc import Loader
import abc


# Public API
from ._abc import Loader

__all__ = [
'Loader', 'MetaPathFinder', 'PathEntryFinder',
'ResourceLoader', 'InspectLoader', 'ExecutionLoader',
Expand Down
6 changes: 4 additions & 2 deletions Lib/importlib/machinery.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
"""The machinery of importlib: finders, loaders, hooks, etc."""

lazy import warnings


# Public API
from ._bootstrap import ModuleSpec
from ._bootstrap import BuiltinImporter
from ._bootstrap import FrozenImporter
Expand Down Expand Up @@ -33,8 +37,6 @@ def all_suffixes():


def __getattr__(name):
import warnings

if name == 'DEBUG_BYTECODE_SUFFIXES':
warnings.warn('importlib.machinery.DEBUG_BYTECODE_SUFFIXES is '
'deprecated; use importlib.machinery.BYTECODE_SUFFIXES '
Expand Down
16 changes: 10 additions & 6 deletions Lib/importlib/util.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
"""Utility code for constructing importers, etc."""

from ._bootstrap import _resolve_name
from ._bootstrap import _find_spec

import _imp
import sys
import types

Comment thread
brettcannon marked this conversation as resolved.

# Public API
from ._abc import Loader
from ._bootstrap import module_from_spec
from ._bootstrap import _resolve_name
from ._bootstrap import spec_from_loader
from ._bootstrap import _find_spec
from ._bootstrap_external import MAGIC_NUMBER
from ._bootstrap_external import cache_from_source
from ._bootstrap_external import decode_source
from ._bootstrap_external import source_from_cache
from ._bootstrap_external import spec_from_file_location

import _imp
import sys
import types


def source_hash(source_bytes):
"Return the hash of *source_bytes* as used in hash-based pyc files."
Expand Down
Loading