diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-02-27 16:27:23 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-02-27 17:00:48 +0300 |
commit | 6c35e9daf4dc86464e1a262236b8d3593e690ee5 (patch) | |
tree | 2727d5da08d12182c1a705ec7213a6b97f5da521 /contrib/python/setuptools/py3/_distutils_hack/__init__.py | |
parent | 6fa64684d15341dd701bf1498ecafdd764d5f097 (diff) | |
download | ydb-6c35e9daf4dc86464e1a262236b8d3593e690ee5.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/python/setuptools/py3/_distutils_hack/__init__.py')
-rw-r--r-- | contrib/python/setuptools/py3/_distutils_hack/__init__.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/contrib/python/setuptools/py3/_distutils_hack/__init__.py b/contrib/python/setuptools/py3/_distutils_hack/__init__.py index b951c2defd..4d3f09b0ae 100644 --- a/contrib/python/setuptools/py3/_distutils_hack/__init__.py +++ b/contrib/python/setuptools/py3/_distutils_hack/__init__.py @@ -3,16 +3,9 @@ import sys import os -is_pypy = '__pypy__' in sys.builtin_module_names - - def warn_distutils_present(): if 'distutils' not in sys.modules: return - if is_pypy and sys.version_info < (3, 7): - # PyPy for 3.6 unconditionally imports distutils, so bypass the warning - # https://foss.heptapod.net/pypy/pypy/-/blob/be829135bc0d758997b3566062999ee8b23872b4/lib-python/3/site.py#L250 - return import warnings warnings.warn( @@ -90,7 +83,7 @@ class DistutilsMetaFinder: # optimization: only consider top level modules and those # found in the CPython test suite. if path is not None and not fullname.startswith('test.'): - return + return None method_name = 'spec_for_{fullname}'.format(**locals()) method = getattr(self, method_name, lambda: None) @@ -98,7 +91,7 @@ class DistutilsMetaFinder: def spec_for_distutils(self): if self.is_cpython(): - return + return None import importlib import importlib.abc @@ -115,7 +108,7 @@ class DistutilsMetaFinder: # setuptools from the path but only after the hook # has been loaded. Ref #2980. # In either case, fall back to stdlib behavior. - return + return None class DistutilsLoader(importlib.abc.Loader): def create_module(self, spec): |