Lint and mypy fixes.

This commit is contained in:
Itamar Turner-Trauring 2022-06-06 11:00:07 -04:00
parent ca0f311861
commit c3a304e1cc
3 changed files with 5 additions and 5 deletions

View File

@ -586,7 +586,7 @@ class StorageClientImmutables(object):
)
@inlineCallbacks
def list_shares(self, storage_index): # type: (bytes,) -> Deferred[set[int]]
def list_shares(self, storage_index: bytes) -> Deferred[set[int]]:
"""
Return the set of shares for a given storage index.
"""

View File

@ -3,7 +3,7 @@ HTTP server for storage.
"""
from __future__ import annotations
from typing import Dict, List, Set, Tuple, Any, Callable
from typing import Dict, List, Set, Tuple, Any, Callable, Optional
from functools import wraps
from base64 import b64decode
@ -274,7 +274,7 @@ _SCHEMAS = {
}
def read_range(request, read_data: Callable[int, int, bytes]) -> Optional[bytes]:
def read_range(request, read_data: Callable[[int, int], bytes]) -> Optional[bytes]:
"""
Parse the ``Range`` header, read appropriately, return as result.
@ -298,7 +298,7 @@ def read_range(request, read_data: Callable[int, int, bytes]) -> Optional[bytes]
data = read_data(start, start + 65536)
if not data:
request.finish()
return
return None
request.write(data)
start += len(data)

View File

@ -1105,7 +1105,7 @@ class SharedImmutableMutableTestsMixin:
general_client: StorageClientGeneral
client: Union[StorageClientImmutables, StorageClientMutables]
clientFactory: Callable[
StorageClient, Union[StorageClientImmutables, StorageClientMutables]
[StorageClient], Union[StorageClientImmutables, StorageClientMutables]
]
def upload(self, share_number: int, data_length=26) -> Tuple[bytes, bytes, bytes]: