bpo-44464: Remove special exclusion for flake8 in the deprecation warnings. (#26807)

Sync with importlib_metadata 4.6.
This commit is contained in:
Jason R. Coombs 2021-06-27 17:59:18 -04:00 committed by GitHub
parent 2f49c9debc
commit efe7d08d17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 10 deletions

View file

@ -362,14 +362,6 @@ class EntryPoints(DeprecatedList):
)
def flake8_bypass(func):
# defer inspect import as performance optimization.
import inspect
is_flake8 = any('flake8' in str(frame.filename) for frame in inspect.stack()[:5])
return func if not is_flake8 else lambda: None
class Deprecated:
"""
Compatibility add-in for mapping to indicate that
@ -405,7 +397,7 @@ class Deprecated:
return super().__getitem__(name)
def get(self, name, default=None):
flake8_bypass(self._warn)()
self._warn()
return super().get(name, default)
def __iter__(self):