File tree 3 files changed +6
-7
lines changed
3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
1
"""Expose backports in a single place."""
2
2
import sys
3
- from functools import lru_cache
4
3
5
4
if sys .version_info >= (3 , 8 ): # pragma: no cover (PY38+)
6
5
import importlib .metadata as importlib_metadata
7
6
else : # pragma: no cover (<PY38)
8
7
import importlib_metadata
9
8
10
- __all__ = ("lru_cache" , " importlib_metadata" )
9
+ __all__ = ("importlib_metadata" , )
Original file line number Diff line number Diff line change 4
4
import contextlib
5
5
import copy
6
6
import enum
7
+ import functools
7
8
import itertools
8
9
import linecache
9
10
import logging
20
21
from flake8 import defaults
21
22
from flake8 import statistics
22
23
from flake8 import utils
23
- from flake8 ._compat import lru_cache
24
24
from flake8 .formatting import base as base_formatter
25
25
26
26
__all__ = ("StyleGuide" ,)
@@ -49,7 +49,7 @@ class Decision(enum.Enum):
49
49
Selected = "selected error"
50
50
51
51
52
- @lru_cache (maxsize = 512 )
52
+ @functools . lru_cache (maxsize = 512 )
53
53
def find_noqa (physical_line ): # type: (str) -> Optional[Match[str]]
54
54
return defaults .NOQA_INLINE_REGEXP .search (physical_line )
55
55
@@ -374,7 +374,7 @@ def populate_style_guides_with(self, options):
374
374
filename = filename , extend_ignore_with = violations
375
375
)
376
376
377
- @lru_cache (maxsize = None )
377
+ @functools . lru_cache (maxsize = None )
378
378
def style_guide_for (self , filename ): # type: (str) -> StyleGuide
379
379
"""Find the StyleGuide for the filename in particular."""
380
380
guides = sorted (
Original file line number Diff line number Diff line change 1
1
"""Utility methods for flake8."""
2
2
import collections
3
3
import fnmatch as _fnmatch
4
+ import functools
4
5
import inspect
5
6
import io
6
7
import logging
21
22
from typing import Union
22
23
23
24
from flake8 import exceptions
24
- from flake8 ._compat import lru_cache
25
25
26
26
if False : # `typing.TYPE_CHECKING` was introduced in 3.5.2
27
27
from flake8 .plugins .manager import Plugin
@@ -209,7 +209,7 @@ def _stdin_get_value_py3(): # type: () -> str
209
209
return stdin_value .decode ("utf-8" )
210
210
211
211
212
- @lru_cache (maxsize = 1 )
212
+ @functools . lru_cache (maxsize = 1 )
213
213
def stdin_get_value (): # type: () -> str
214
214
"""Get and cache it so plugins can use it."""
215
215
return _stdin_get_value_py3 ()
You can’t perform that action at this time.
0 commit comments