123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- --- 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
|