mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 04:57:54 +00:00
Less code duplication.
This commit is contained in:
parent
52322c25d3
commit
7454929be0
@ -238,7 +238,7 @@ class StorageClientImmutables(object):
|
||||
raise ClientException(
|
||||
response.code,
|
||||
)
|
||||
body = loads((yield response.content()))
|
||||
body = yield _decode_cbor(response)
|
||||
remaining = RangeMap()
|
||||
for chunk in body["required"]:
|
||||
remaining.set(True, chunk["begin"], chunk["end"])
|
||||
@ -293,8 +293,8 @@ class StorageClientImmutables(object):
|
||||
url,
|
||||
)
|
||||
if response.code == http.OK:
|
||||
body = yield response.content()
|
||||
returnValue(set(loads(body)))
|
||||
body = yield _decode_cbor(response)
|
||||
returnValue(set(body))
|
||||
else:
|
||||
raise ClientException(
|
||||
response.code,
|
||||
|
Loading…
Reference in New Issue
Block a user