Skip to content
Open
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
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
17 changes: 11 additions & 6 deletions Lib/importlib/util.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
"""Utility code for constructing importers, etc."""

from ._bootstrap import _resolve_name
from ._bootstrap import _find_spec

import sys
import types

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we separate them from regular imports, or group them together? In dataclasses, inspect, http.cookies and ast we have them together, but in argparse we don't.

lazy import _imp


# 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