Skip to content

Commit 1ac5281

Browse files
bump: 2.8.6
1 parent 7b6447f commit 1ac5281

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ Run
347347
- 2.8.3 Fix key error
348348
- 2.8.4 Feat resist cache perms
349349
- 2.8.5 Fix cache not found on perms error
350+
- 2.8.6 Fix none error on no cache data
350351

351352
## 2.8.0
352353

meteomoris/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
get_latest = Meteo.get_latest
2020
get_uvindex = Meteo.get_uvindex
2121

22-
__version__ = "2.8.5"
22+
__version__ = "2.8.6"

meteomoris/meteo.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,16 @@ def get_from_cache(cls, key):
122122

123123
@classmethod
124124
def add_to_cache(cls, key, data):
125-
cache_data = cls.get_cache_data()
126-
cache_data[cls.today][key] = data
125+
127126

128127
try:
128+
cache_data = cls.get_cache_data()
129+
cache_data[cls.today][key] = data
129130
with open(cache_path(), 'w+') as f:
130131
json.dump(cache_data, f)
131132
cls.CACHE_PERMS = True
133+
except TypeError:
134+
cls.CACHE_PERMS = False
132135
except PermissionError:
133136
cls.CACHE_PERMS = False
134137

0 commit comments

Comments
 (0)