From 9db5a397e1d88929b775c464042fa7ffcb736501 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Thu, 14 Apr 2022 11:45:47 -0400 Subject: [PATCH] Minor type annotation improvements. --- src/allmydata/storage/http_client.py | 4 +++- src/allmydata/storage/http_common.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/allmydata/storage/http_client.py b/src/allmydata/storage/http_client.py index 6ff462d73..9a2774aef 100644 --- a/src/allmydata/storage/http_client.py +++ b/src/allmydata/storage/http_client.py @@ -2,6 +2,8 @@ HTTP client that talks to the HTTP storage server. """ +from __future__ import annotations + from typing import Union, Set, Optional from base64 import b64encode @@ -214,7 +216,7 @@ class StorageClient(object): self._treq = treq @classmethod - def from_nurl(cls, nurl: DecodedURL, reactor, persistent: bool = True) -> "StorageClient": + def from_nurl(cls, nurl: DecodedURL, reactor, persistent: bool = True) -> StorageClient: """ Create a ``StorageClient`` for the given NURL. diff --git a/src/allmydata/storage/http_common.py b/src/allmydata/storage/http_common.py index bd88f9fae..addd926d1 100644 --- a/src/allmydata/storage/http_common.py +++ b/src/allmydata/storage/http_common.py @@ -27,7 +27,7 @@ def get_content_type(headers: Headers) -> Optional[str]: return content_type -def swissnum_auth_header(swissnum): # type: (bytes) -> bytes +def swissnum_auth_header(swissnum: bytes) -> bytes: """Return value for ``Authentication`` header.""" return b"Tahoe-LAFS " + b64encode(swissnum).strip()