Skip to content

Commit

Permalink
Merge pull request #319 from python/feature/uniform
Browse files Browse the repository at this point in the history
Remove SelectableGroups deprecation exception for flake8.
  • Loading branch information
jaraco committed Jun 3, 2021
2 parents dba300f + abfe23b commit 1cabd5f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
@@ -1,3 +1,9 @@
v4.5.0
=======

* #319: Remove ``SelectableGroups`` deprecation exception
for flake8.

v4.4.0
=======

Expand Down
10 changes: 1 addition & 9 deletions importlib_metadata/__init__.py
Expand Up @@ -367,14 +367,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 @@ -410,7 +402,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
2 changes: 2 additions & 0 deletions pytest.ini
Expand Up @@ -5,3 +5,5 @@ doctest_optionflags=ALLOW_UNICODE ELLIPSIS
# workaround for warning pytest-dev/pytest#6178
junit_family=xunit2
filterwarnings=
# Suppress deprecation warning in flake8
ignore:SelectableGroups dict interface is deprecated::flake8

0 comments on commit 1cabd5f

Please sign in to comment.