Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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>`
Expand Down
10 changes: 1 addition & 9 deletions Lib/importlib/metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,6 @@ def _parse_groups(text):
)


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
Expand Down Expand Up @@ -405,7 +397,7 @@ def __getitem__(self, name):
return super().__getitem__(name)

def get(self, name, default=None):
flake8_bypass(self._warn)()
self._warn()
return super().get(name, default)

def __iter__(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove exception for flake8 in deprecated importlib.metadata interfaces.
Sync with importlib_metadata 4.6.