mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 10:36:53 +00:00
fix memory leak caused by lru_cache of a method
This commit is contained in:
parent
94ed800b2a
commit
befc26f78e
1 changed files with 5 additions and 2 deletions
|
|
@ -240,6 +240,10 @@ class StyleGuideManager:
|
|||
)
|
||||
)
|
||||
|
||||
self.style_guide_for = functools.lru_cache(maxsize=None)(
|
||||
self._style_guide_for
|
||||
)
|
||||
|
||||
def populate_style_guides_with(
|
||||
self, options: argparse.Namespace
|
||||
) -> Generator["StyleGuide", None, None]:
|
||||
|
|
@ -256,8 +260,7 @@ class StyleGuideManager:
|
|||
filename=filename, extend_ignore_with=violations
|
||||
)
|
||||
|
||||
@functools.lru_cache(maxsize=None)
|
||||
def style_guide_for(self, filename: str) -> "StyleGuide":
|
||||
def _style_guide_for(self, filename: str) -> "StyleGuide":
|
||||
"""Find the StyleGuide for the filename in particular."""
|
||||
guides = sorted(
|
||||
(g for g in self.style_guides if g.applies_to(filename)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue