File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 5
5
import sys
6
6
import zipp
7
7
import email
8
+ import inspect
8
9
import pathlib
9
10
import operator
10
11
import warnings
11
12
import functools
12
13
import itertools
13
14
import posixpath
15
+ import contextlib
14
16
import collections .abc
15
17
16
18
from ._compat import (
@@ -227,6 +229,13 @@ def select(self, **params):
227
229
return self ._all .select (** params )
228
230
229
231
232
+ class Flake8Bypass (warnings .catch_warnings , contextlib .ContextDecorator ):
233
+ def __enter__ (self ):
234
+ super ().__enter__ ()
235
+ is_flake8 = any ('flake8' in str (frame ) for frame in inspect .stack ())
236
+ is_flake8 and warnings .simplefilter ('ignore' , DeprecationWarning )
237
+
238
+
230
239
class DeprecatedDict (dict ):
231
240
"""
232
241
Compatibility wrapper around dict to indicate that
@@ -252,6 +261,7 @@ def __getitem__(self, name):
252
261
self ._warn ()
253
262
return super ().__getitem__ (name )
254
263
264
+ @Flake8Bypass ()
255
265
def get (self , name , default = None ):
256
266
self ._warn ()
257
267
return super ().get (name , default )
You can’t perform that action at this time.
0 commit comments