Skip to content

Commit

Permalink
Hide the deprecation warning from flake8 users
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 16, 2021
1 parent 9448e13 commit 25c9634
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions importlib_metadata/__init__.py
Expand Up @@ -191,6 +191,8 @@ def get(self, group, default=None):
"""
For backward compatibility, supply .get
"""
if any('flake8' in str(frame) for frame in inspect.stack()):
return
msg = "GroupedEntryPoints.get is deprecated. Just use __getitem__."
warnings.warn(msg, DeprecationWarning)
return self[group] or default
Expand Down

0 comments on commit 25c9634

Please sign in to comment.