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

@ -1084,7 +1084,7 @@ and will be incorrect in some rare cases, including some ``_``-s in
importlib.metadata importlib.metadata
------------------ ------------------
Feature parity with ``importlib_metadata`` 4.4 Feature parity with ``importlib_metadata`` 4.6
(`history <https://importlib-metadata.readthedocs.io/en/latest/history.html>`_). (`history <https://importlib-metadata.readthedocs.io/en/latest/history.html>`_).
:ref:`importlib.metadata entry points <entry-points>` :ref:`importlib.metadata entry points <entry-points>`

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: class Deprecated:
""" """
Compatibility add-in for mapping to indicate that Compatibility add-in for mapping to indicate that
@ -405,7 +397,7 @@ class Deprecated:
return super().__getitem__(name) return super().__getitem__(name)
def get(self, name, default=None): def get(self, name, default=None):
flake8_bypass(self._warn)() self._warn()
return super().get(name, default) return super().get(name, default)
def __iter__(self): def __iter__(self):

View file

@ -0,0 +1,2 @@
Remove exception for flake8 in deprecated importlib.metadata interfaces.
Sync with importlib_metadata 4.6.