1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- --- 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():
|