diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-04-18 12:39:32 +0300 |
---|---|---|
committer | shadchin <shadchin@yandex-team.ru> | 2022-04-18 12:39:32 +0300 |
commit | d4be68e361f4258cf0848fc70018dfe37a2acc24 (patch) | |
tree | 153e294cd97ac8b5d7a989612704a0c1f58e8ad4 /contrib/tools/python3/src/Lib/importlib/util.py | |
parent | 260c02f5ccf242d9d9b8a873afaf6588c00237d6 (diff) | |
download | ydb-d4be68e361f4258cf0848fc70018dfe37a2acc24.tar.gz |
IGNIETFERRO-1816 Update Python 3 from 3.9.12 to 3.10.4
ref:9f96be6d02ee8044fdd6f124b799b270c20ce641
Diffstat (limited to 'contrib/tools/python3/src/Lib/importlib/util.py')
-rw-r--r-- | contrib/tools/python3/src/Lib/importlib/util.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/contrib/tools/python3/src/Lib/importlib/util.py b/contrib/tools/python3/src/Lib/importlib/util.py index 269a6fa930..8623c89840 100644 --- a/contrib/tools/python3/src/Lib/importlib/util.py +++ b/contrib/tools/python3/src/Lib/importlib/util.py @@ -1,5 +1,5 @@ """Utility code for constructing importers, etc.""" -from . import abc +from ._abc import Loader from ._bootstrap import module_from_spec from ._bootstrap import _resolve_name from ._bootstrap import spec_from_loader @@ -149,7 +149,8 @@ def set_package(fxn): """ @functools.wraps(fxn) def set_package_wrapper(*args, **kwargs): - warnings.warn('The import system now takes care of this automatically.', + warnings.warn('The import system now takes care of this automatically; ' + 'this decorator is slated for removal in Python 3.12', DeprecationWarning, stacklevel=2) module = fxn(*args, **kwargs) if getattr(module, '__package__', None) is None: @@ -168,7 +169,8 @@ def set_loader(fxn): """ @functools.wraps(fxn) def set_loader_wrapper(self, *args, **kwargs): - warnings.warn('The import system now takes care of this automatically.', + warnings.warn('The import system now takes care of this automatically; ' + 'this decorator is slated for removal in Python 3.12', DeprecationWarning, stacklevel=2) module = fxn(self, *args, **kwargs) if getattr(module, '__loader__', None) is None: @@ -195,7 +197,8 @@ def module_for_loader(fxn): the second argument. """ - warnings.warn('The import system now takes care of this automatically.', + warnings.warn('The import system now takes care of this automatically; ' + 'this decorator is slated for removal in Python 3.12', DeprecationWarning, stacklevel=2) @functools.wraps(fxn) def module_for_loader_wrapper(self, fullname, *args, **kwargs): @@ -232,7 +235,6 @@ class _LazyModule(types.ModuleType): # Figure out exactly what attributes were mutated between the creation # of the module and now. attrs_then = self.__spec__.loader_state['__dict__'] - original_type = self.__spec__.loader_state['__class__'] attrs_now = self.__dict__ attrs_updated = {} for key, value in attrs_now.items(): @@ -263,7 +265,7 @@ class _LazyModule(types.ModuleType): delattr(self, attr) -class LazyLoader(abc.Loader): +class LazyLoader(Loader): """A loader that creates a module which defers loading until attribute access.""" |