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 c9adbca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions importlib_metadata/__init__.py
Expand Up @@ -5,6 +5,7 @@
import sys
import zipp
import email
import inspect
import pathlib
import operator
import warnings
Expand Down Expand Up @@ -191,6 +192,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 c9adbca

Please sign in to comment.