aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/importlib-metadata/py3/patches/02-fix-for-support-system-python.patch
diff options
context:
space:
mode:
authormaxim-yurchuk <maxim-yurchuk@yandex-team.com>2024-10-09 12:29:46 +0300
committermaxim-yurchuk <maxim-yurchuk@yandex-team.com>2024-10-09 13:14:22 +0300
commit9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80 (patch)
treea8fb3181d5947c0d78cf402aa56e686130179049 /contrib/python/importlib-metadata/py3/patches/02-fix-for-support-system-python.patch
parenta44b779cd359f06c3ebbef4ec98c6b38609d9d85 (diff)
downloadydb-9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80.tar.gz
publishFullContrib: true for ydb
<HIDDEN_URL> commit_hash:c82a80ac4594723cebf2c7387dec9c60217f603e
Diffstat (limited to 'contrib/python/importlib-metadata/py3/patches/02-fix-for-support-system-python.patch')
-rw-r--r--contrib/python/importlib-metadata/py3/patches/02-fix-for-support-system-python.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/contrib/python/importlib-metadata/py3/patches/02-fix-for-support-system-python.patch b/contrib/python/importlib-metadata/py3/patches/02-fix-for-support-system-python.patch
new file mode 100644
index 0000000000..0babc06099
--- /dev/null
+++ b/contrib/python/importlib-metadata/py3/patches/02-fix-for-support-system-python.patch
@@ -0,0 +1,51 @@
+--- contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py (index)
++++ contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py (working tree)
+@@ -31,4 +31,10 @@ from importlib.abc import MetaPathFinder
+ from typing import List, Mapping, Optional
+
++try:
++ import __res as res
++ ARCADIA = True
++except ImportError:
++ ARCADIA = False
++
+
+ __all__ = [
+@@ -712,3 +718,3 @@ class Prepared:
+
+-@install
++@install(ARCADIA == False)
+ class MetadataPathFinder(NullFinder, DistributionFinder):
+@@ -813,3 +819,3 @@ class ArcadiaDistribution(Distribution):
+
+-@install
++@install(ARCADIA == True)
+ class ArcadiaMetadataFinder(NullFinder, DistributionFinder):
+--- contrib/python/importlib-metadata/py3/importlib_metadata/_compat.py (index)
++++ contrib/python/importlib-metadata/py3/importlib_metadata/_compat.py (working tree)
+@@ -15,11 +15,14 @@ except ImportError: # pragma: no cover
+-def install(cls):
+- """
+- Class decorator for installation on sys.meta_path.
+-
+- Adds the backport DistributionFinder to sys.meta_path and
+- attempts to disable the finder functionality of the stdlib
+- DistributionFinder.
+- """
+- sys.meta_path.append(cls())
+- disable_stdlib_finder()
+- return cls
++def install(flag):
++ def dec_install(cls):
++ """
++ Class decorator for installation on sys.meta_path.
++
++ Adds the backport DistributionFinder to sys.meta_path and
++ attempts to disable the finder functionality of the stdlib
++ DistributionFinder.
++ """
++ if flag:
++ sys.meta_path.append(cls())
++ disable_stdlib_finder()
++ return cls
++ return dec_install