From 25c96345cf9dd7f2db7d056a3ad978694140008f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 15 Feb 2021 21:28:16 -0500 Subject: [PATCH] Hide the deprecation warning from flake8 users --- importlib_metadata/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/importlib_metadata/__init__.py b/importlib_metadata/__init__.py index 4c8188ae..4c6f7bc5 100644 --- a/importlib_metadata/__init__.py +++ b/importlib_metadata/__init__.py @@ -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