]>
crepu.dev Git - config.git/blob - djavu-asus/elpy/rpc-venv/lib/python3.11/site-packages/setuptools/_importlib.py
4 def disable_importlib_metadata_finder(metadata
):
6 Ensure importlib_metadata doesn't provide older, incompatible
12 import importlib_metadata
15 except AttributeError:
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`."
23 warnings
.warn(msg
) # Ensure a descriptive message is shown.
24 raise # This exception can be suppressed by _distutils_hack
26 if importlib_metadata
is metadata
:
30 for ob
in sys
.meta_path
31 if isinstance(ob
, importlib_metadata
.MetadataPathFinder
)
33 for item
in to_remove
:
34 sys
.meta_path
.remove(item
)
37 if sys
.version_info
< (3, 10):
38 from setuptools
.extern
import importlib_metadata
as metadata
39 disable_importlib_metadata_finder(metadata
)
41 import importlib
.metadata
as metadata
# noqa: F401
44 if sys
.version_info
< (3, 9):
45 from setuptools
.extern
import importlib_resources
as resources
47 import importlib
.resources
as resources
# noqa: F401