Skip to content

Commit

Permalink
Remove leaky lru_cache (#2277)
Browse files Browse the repository at this point in the history
* Remove leaky lru_cache

* Update changelog

---------

Co-authored-by: Steven Loria <[email protected]>
  • Loading branch information
mrcljx and sloria authored Jun 6, 2024
1 parent 47205b5 commit 99103a6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,4 @@ Contributors (chronological)
- Aditya Tewary `@aditkumar72 <https://github.com/aditkumar72>`_
- Sebastien Lovergne `@TheBigRoomXXL <https://github.com/TheBigRoomXXL>`_
- Peter C `@somethingnew2-0 <https://github.com/somethingnew2-0>`_
- Marcel Jackwerth `@mrcljx` <https://github.com/mrcljx>`_
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
---------

3.21.3 (unreleased)
*******************

Bug fixes:

- Fix memory leak that prevented schema instances from getting GC'd (:pr:`2277`).
Thanks :user:`mrcljx` for the PR.

3.21.2 (2024-05-01)
*******************

Expand Down
2 changes: 0 additions & 2 deletions src/marshmallow/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from abc import ABCMeta
from collections import OrderedDict, defaultdict
from collections.abc import Mapping
from functools import lru_cache

from marshmallow import base, class_registry, types
from marshmallow import fields as ma_fields
Expand Down Expand Up @@ -1056,7 +1055,6 @@ def _bind_field(self, field_name: str, field_obj: ma_fields.Field) -> None:
raise error
self.on_bind_field(field_name, field_obj)

@lru_cache(maxsize=8) # noqa (https://github.com/PyCQA/flake8-bugbear/issues/310)
def _has_processors(self, tag) -> bool:
return bool(self._hooks[(tag, True)] or self._hooks[(tag, False)])

Expand Down

0 comments on commit 99103a6

Please sign in to comment.