mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-44464: Remove special exclusion for flake8 in the deprecation warnings. (#26807)
Sync with importlib_metadata 4.6.
This commit is contained in:
parent
2f49c9debc
commit
efe7d08d17
3 changed files with 4 additions and 10 deletions
|
@ -1084,7 +1084,7 @@ and will be incorrect in some rare cases, including some ``_``-s in
|
|||
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>`_).
|
||||
|
||||
:ref:`importlib.metadata entry points <entry-points>`
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Remove exception for flake8 in deprecated importlib.metadata interfaces.
|
||||
Sync with importlib_metadata 4.6.
|
Loading…
Add table
Add a link
Reference in a new issue