Skip to content

Commit

Permalink
Prevent access to attribute if cache_value is None (#8)
Browse files Browse the repository at this point in the history
* Prevent access to attribute if cache_value is None

* Bump version
  • Loading branch information
jbonet-df authored Jun 28, 2023
1 parent 672370f commit c3759d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion onecache/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ def get(self, key):
if cache_value:
with self._scoped():
self._increment(cache_value)
return cache_value.value
return cache_value.value

return None

def _increment(self, val: CacheValue):
val.increment()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def requirements(filename):

setup(
name="onecache",
version="0.5.0",
version="0.5.1",
description="Python cache for sync and async code",
long_description=read_file("README.md"),
long_description_content_type="text/markdown",
Expand Down

0 comments on commit c3759d5

Please sign in to comment.