Skip to content

Commit

Permalink
Handle zero-sized cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielballan committed Apr 3, 2024
1 parent db55b43 commit 1d9b9c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tiled/adapters/resource_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ def with_resource_cache(
return value
# Generate value and offer it to the cache.
value = factory(*args, **kwargs)
cache[cache_key] = value
if cache.maxsize: # handle size 0 cache
cache[cache_key] = value
return value

0 comments on commit 1d9b9c5

Please sign in to comment.