aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Lib/importlib/util.py
diff options
context:
space:
mode:
authorAlexSm <alex@ydb.tech>2024-08-19 16:16:30 +0200
committerGitHub <noreply@github.com>2024-08-19 17:16:30 +0300
commit9b567afd3339f4525feab53873592cb025b14251 (patch)
tree5c8489f98dc5a9a10f66065055e5a401bbd14767 /contrib/tools/python3/Lib/importlib/util.py
parent47bd121575c210d4bbb2dddcc2131759a694df05 (diff)
downloadydb-9b567afd3339f4525feab53873592cb025b14251.tar.gz
Library import 240819-0942 (#7994)
Co-authored-by: robot-piglet <robot-piglet@yandex-team.com> Co-authored-by: hiddenpath <hiddenpath@yandex-team.com> Co-authored-by: bulatman <bulatman@yandex-team.com> Co-authored-by: robot-contrib <robot-contrib@yandex-team.com> Co-authored-by: osidorkin <osidorkin@yandex-team.com> Co-authored-by: akhropov <akhropov@yandex-team.com> Co-authored-by: akozhikhov <akozhikhov@yandex-team.com> Co-authored-by: orlovorlov <orlovorlov@yandex-team.com> Co-authored-by: babenko <babenko@yandex-team.com> Co-authored-by: shadchin <shadchin@yandex-team.com> Co-authored-by: dmasloff <dmasloff@yandex-team.com> Co-authored-by: aleksei-le <aleksei-le@yandex-team.com> Co-authored-by: coteeq <coteeq@yandex-team.com> Co-authored-by: dimdim11 <dimdim11@yandex-team.com> Co-authored-by: robot-ya-builder <robot-ya-builder@yandex-team.com> Co-authored-by: iaz1607 <iaz1607@yandex-team.com>
Diffstat (limited to 'contrib/tools/python3/Lib/importlib/util.py')
-rw-r--r--contrib/tools/python3/Lib/importlib/util.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/tools/python3/Lib/importlib/util.py b/contrib/tools/python3/Lib/importlib/util.py
index 3743e6aa912..4b836f47120 100644
--- a/contrib/tools/python3/Lib/importlib/util.py
+++ b/contrib/tools/python3/Lib/importlib/util.py
@@ -13,7 +13,6 @@ from ._bootstrap_external import spec_from_file_location
import _imp
import sys
-import threading
import types
@@ -253,6 +252,9 @@ class LazyLoader(Loader):
def exec_module(self, module):
"""Make the module load lazily."""
+ # Threading is only needed for lazy loading, and importlib.util can
+ # be pulled in at interpreter startup, so defer until needed.
+ import threading
module.__spec__.loader = self.loader
module.__loader__ = self.loader
# Don't need to worry about deep-copying as trying to set an attribute