clear_distutils()
self.spec_for_distutils = lambda: None
- @staticmethod
- def pip_imported_during_build():
+ @classmethod
+ def pip_imported_during_build(cls):
"""
Detect if pip is being imported in a build script. Ref #2355.
"""
import traceback
return any(
- frame.f_globals['__file__'].endswith('setup.py')
+ cls.frame_file_is_setup(frame)
for frame, line in traceback.walk_stack(None)
)
+ @staticmethod
+ def frame_file_is_setup(frame):
+ """
+ Return True if the indicated frame suggests a setup.py file.
+ """
+ # some frames may not have __file__ (#2940)
+ return frame.f_globals.get('__file__', '').endswith('setup.py')
+
DISTUTILS_FINDER = DistutilsMetaFinder()
[metadata]
name = setuptools
-version = 60.0.2
+version = 60.0.3
author = Python Packaging Authority
author_email = distutils-sig@python.org
description = Easily download, build, install, upgrade, and uninstall Python packages