mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-11 12:01:44 +00:00
Type check fixes.
This commit is contained in:
parent
aca35a553d
commit
d8f176bb8f
@ -5,7 +5,17 @@ HTTP client that talks to the HTTP storage server.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
|
||||||
from typing import Union, Optional, Sequence, Mapping, BinaryIO, cast, TypedDict, Set
|
from typing import (
|
||||||
|
Union,
|
||||||
|
Optional,
|
||||||
|
Sequence,
|
||||||
|
Mapping,
|
||||||
|
BinaryIO,
|
||||||
|
cast,
|
||||||
|
TypedDict,
|
||||||
|
Set,
|
||||||
|
Dict,
|
||||||
|
)
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from os import SEEK_END
|
from os import SEEK_END
|
||||||
@ -506,14 +516,14 @@ class StorageClientGeneral(object):
|
|||||||
url = self._client.relative_url("/storage/v1/version")
|
url = self._client.relative_url("/storage/v1/version")
|
||||||
response = await self._client.request("GET", url)
|
response = await self._client.request("GET", url)
|
||||||
decoded_response = cast(
|
decoded_response = cast(
|
||||||
Mapping[bytes, object],
|
Dict[bytes, object],
|
||||||
await self._client.decode_cbor(response, _SCHEMAS["get_version"]),
|
await self._client.decode_cbor(response, _SCHEMAS["get_version"]),
|
||||||
)
|
)
|
||||||
# Add some features we know are true because the HTTP API
|
# Add some features we know are true because the HTTP API
|
||||||
# specification requires them and because other parts of the storage
|
# specification requires them and because other parts of the storage
|
||||||
# client implementation assumes they will be present.
|
# client implementation assumes they will be present.
|
||||||
cast(
|
cast(
|
||||||
Mapping[bytes, object],
|
Dict[bytes, object],
|
||||||
decoded_response[b"http://allmydata.org/tahoe/protocols/storage/v1"],
|
decoded_response[b"http://allmydata.org/tahoe/protocols/storage/v1"],
|
||||||
).update(
|
).update(
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user