8000 Hide the deprecation warning from flake8 users · python/importlib_metadata@25c9634 · GitHub
[go: up one dir, main page]

Skip to content

Commit 25c9634

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

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

importlib_metadata/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ def get(self, group, default=None):
191191
"""
192192
For backward compatibility, supply .get
193193
"""
194+
if any('flake8' in str(frame) for frame in inspect.stack()):
195+
return
194196
msg = "GroupedEntryPoints.get is deprecated. Just use __getitem__."
195197
warnings.warn(msg, DeprecationWarning)
196198
return self[group] or default

0 commit comments

Comments
 (0)
0