Skip to content
Closed
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
3 changes: 1 addition & 2 deletions Lib/importlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
# Fully bootstrapped at this point, import whatever you like, circular
# dependencies and startup overhead minimisation permitting :)

import warnings


# Public API #########################################################

Expand All @@ -78,6 +76,7 @@ def find_loader(name, path=None):
This function is deprecated in favor of importlib.util.find_spec().

"""
import warnings
warnings.warn('Deprecated since Python 3.4. '
'Use importlib.util.find_spec() instead.',
DeprecationWarning, stacklevel=2)
Expand Down
4 changes: 3 additions & 1 deletion Lib/importlib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import functools
import sys
import types
import warnings


def source_hash(source_bytes):
Expand Down Expand Up @@ -149,6 +148,7 @@ def set_package(fxn):
"""
@functools.wraps(fxn)
def set_package_wrapper(*args, **kwargs):
import warnings
warnings.warn('The import system now takes care of this automatically.',
DeprecationWarning, stacklevel=2)
module = fxn(*args, **kwargs)
Expand All @@ -168,6 +168,7 @@ def set_loader(fxn):
"""
@functools.wraps(fxn)
def set_loader_wrapper(self, *args, **kwargs):
import warnings
warnings.warn('The import system now takes care of this automatically.',
DeprecationWarning, stacklevel=2)
module = fxn(self, *args, **kwargs)
Expand Down Expand Up @@ -195,6 +196,7 @@ def module_for_loader(fxn):
the second argument.

"""
import warnings
warnings.warn('The import system now takes care of this automatically.',
DeprecationWarning, stacklevel=2)
@functools.wraps(fxn)
Expand Down