]> crepu.dev Git - config.git/blame - djavu-asus/elpy/rpc-venv/lib/python3.11/site-packages/setuptools/_importlib.py
Configuracion en desarrollo PC pega
[config.git] / djavu-asus / elpy / rpc-venv / lib / python3.11 / site-packages / setuptools / _importlib.py
CommitLineData
53e6db90
DC
1import sys
2
3
4def disable_importlib_metadata_finder(metadata):
5 """
6 Ensure importlib_metadata doesn't provide older, incompatible
7 Distributions.
8
9 Workaround for #3102.
10 """
11 try:
12 import importlib_metadata
13 except ImportError:
14 return
15 except AttributeError:
16 import warnings
17
18 msg = (
19 "`importlib-metadata` version is incompatible with `setuptools`.\n"
20 "This problem is likely to be solved by installing an updated version of "
21 "`importlib-metadata`."
22 )
23 warnings.warn(msg) # Ensure a descriptive message is shown.
24 raise # This exception can be suppressed by _distutils_hack
25
26 if importlib_metadata is metadata:
27 return
28 to_remove = [
29 ob
30 for ob in sys.meta_path
31 if isinstance(ob, importlib_metadata.MetadataPathFinder)
32 ]
33 for item in to_remove:
34 sys.meta_path.remove(item)
35
36
37if sys.version_info < (3, 10):
38 from setuptools.extern import importlib_metadata as metadata
39 disable_importlib_metadata_finder(metadata)
40else:
41 import importlib.metadata as metadata # noqa: F401
42
43
44if sys.version_info < (3, 9):
45 from setuptools.extern import importlib_resources as resources
46else:
47 import importlib.resources as resources # noqa: F401