Skip to content

Commit c9adbca

Browse files
committed
Hide the deprecation warning from flake8 users
1 parent 9448e13 commit c9adbca

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

importlib_metadata/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sys
66
import zipp
77
import email
8+
import inspect
89
import pathlib
910
import operator
1011
import warnings
@@ -191,6 +192,8 @@ def get(self, group, default=None):
191192
"""
192193
For backward compatibility, supply .get
193194
"""
195+
if any('flake8' in str(frame) for frame in inspect.stack()):
196+
return
194197
msg = "GroupedEntryPoints.get is deprecated. Just use __getitem__."
195198
warnings.warn(msg, DeprecationWarning)
196199
return self[group] or default

0 commit comments

Comments
 (0)