Fix cache_memoize to work with non-sequence data.

Review Request #11856 — Created Oct. 17, 2021 and submitted — Latest diff uploaded

Information

Djblets
release-2.x

Reviewers

The size checks in cache_memoize were causing it to fail when the
cached function was returning something other than a sequence. This
change fixes it so we only do those length checks for string types.

While I was in here I fixed up a few small style issues.

  • Used with a change that required this.
  • Ran unit tests.

Diff Revision 3 (Latest)

orig
1
2
3

Commits

First Last Summary ID Author
Fix cache_memoize to work with non-sequence data.
The size checks in cache_memoize were causing it to fail when the cached function was returning something other than a sequence. This change fixes it so we only do those length checks for string types. While I was in here I fixed up a few small style issues. Testing Done: - Used with a change that required this. - Ran unit tests.
dcfd5df252230cd99ee1995d573918812fb2f714 David Trowbridge
djblets/cache/backend.py
djblets/cache/tests/test_backend.py
Loading...