File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -149,19 +149,20 @@ def _put_nosync(self, d):
149
149
if self .cache :
150
150
self ._cached_asdict = d
151
151
else :
152
- if self .key in self .store :
152
+ try :
153
+ meta_unparsed = self .store [self .key ]
153
154
# Cannot write the attributes directly to JSON, but have to
154
155
# store it within the pre-existing attributes key of the v3
155
156
# metadata.
156
157
157
158
# Note: this changes the store.counter result in test_caching_on!
158
159
159
- meta = self .store ._metadata_class .parse_metadata (self . store [ self . key ] )
160
+ meta = self .store ._metadata_class .parse_metadata (meta_unparsed )
160
161
if "attributes" in meta and "filters" in meta ["attributes" ]:
161
162
# need to preserve any existing "filters" attribute
162
163
d ["attributes" ]["filters" ] = meta ["attributes" ]["filters" ]
163
164
meta ["attributes" ] = d ["attributes" ]
164
- else :
165
+ except KeyError :
165
166
meta = d
166
167
self .store [self .key ] = json_dumps (meta )
167
168
if self .cache :
You can’t perform that action at this time.
0 commit comments