aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/importlib-metadata/py2/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/py2/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/py2/patches/02-fix-for-support-system-python.patch')
-rw-r--r--contrib/python/importlib-metadata/py2/patches/02-fix-for-support-system-python.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/contrib/python/importlib-metadata/py2/patches/02-fix-for-support-system-python.patch b/contrib/python/importlib-metadata/py2/patches/02-fix-for-support-system-python.patch
new file mode 100644
index 0000000000..b45958358c
--- /dev/null
+++ b/contrib/python/importlib-metadata/py2/patches/02-fix-for-support-system-python.patch
@@ -0,0 +1,59 @@
+--- contrib/python/importlib-metadata/py2/importlib_metadata/__init__.py (index)
++++ contrib/python/importlib-metadata/py2/importlib_metadata/__init__.py (working tree)
+@@ -33,6 +33,11 @@ from ._compat import (
+ from importlib import import_module
+ from itertools import starmap
+
++try:
++ import library.python.resource
++ ARCADIA = True
++except ImportError:
++ ARCADIA = False
+
+ __metaclass__ = type
+
+@@ -524,7 +529,7 @@ class Prepared:
+ and base.endswith('.egg'))
+
+
+-#@install
++@install(ARCADIA == False)
+ class MetadataPathFinder(NullFinder, DistributionFinder):
+ """A degenerate finder for distribution packages on the file system.
+
+@@ -588,7 +593,7 @@ class ArcadiaDistribution(Distribution):
+ return '{}{}'.format(self.prefix, path)
+
+
+-@install
++@install(ARCADIA == True)
+ class ArcadiaMetadataFinder(NullFinder, DistributionFinder):
+
+ prefixes = {}
+--- contrib/python/importlib-metadata/py2/importlib_metadata/_compat.py (index)
++++ contrib/python/importlib-metadata/py2/importlib_metadata/_compat.py (working tree)
+@@ -56,7 +56,7 @@ __all__ = [
+ ]
+
+
+-def install(cls):
++def install(flag):
+ """
+ Class decorator for installation on sys.meta_path.
+
+@@ -64,9 +64,12 @@ def install(cls):
+ attempts to disable the finder functionality of the stdlib
+ DistributionFinder.
+ """
+- sys.meta_path.append(cls())
+- disable_stdlib_finder()
+- return cls
++ def dec_install(cls):
++ if flag:
++ sys.meta_path.append(cls())
++ disable_stdlib_finder()
++ return cls
++ return dec_install
+
+
+ def disable_stdlib_finder():