mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +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
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue