Skip to content

Commit

Permalink
Make lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
mnot committed Sep 19, 2023
1 parent ccb3d1f commit 86bf370
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions httplint/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
def check_response_caching(response: HttpResponse, request: HttpRequest = None) -> None:
"Examine HTTP caching characteristics of a response."

freshness_lifetime = None # type: int
age = None # type: int
store_shared = None # type: bool
store_private = None # type: bool
freshness_lifetime: int = None
age: int = None
store_shared: bool = None # pylint: disable=unused-variable
store_private: bool = None # pylint: disable=unused-variable

# get header values
lm_hdr = response.headers.parsed.get("last-modified", None)
Expand Down
2 changes: 1 addition & 1 deletion httplint/field_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def find_handler(
If default is true, return a dummy if one isn't found; otherwise, None.
"""

name_token = FieldSection.name_token(field_name) # FIXME: field_aliases
name_token = FieldSection.name_token(field_name)
module = FieldSection.find_field_module(name_token)
if module and hasattr(module, name_token):
return getattr(module, name_token) # type: ignore
Expand Down
14 changes: 7 additions & 7 deletions httplint/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ def __init__(
self,
) -> None:
HttpMessage.__init__(self)
self.method = None # type: str
self.iri = None # type: str
self.uri = None # type: str
self.method: str = None
self.iri: str = None
self.uri: str = None

def process_top_line(self, method: bytes, iri: bytes, version: bytes) -> None:
self.method = method.decode("ascii", "replace")
Expand Down Expand Up @@ -145,8 +145,8 @@ class HttpResponse(HttpMessage):

def __init__(self) -> None:
HttpMessage.__init__(self)
self.status_code = None # type: int
self.status_phrase = ""
self.status_code: int = None
self.status_phrase: str = ""
self.is_head_response = False

def process_top_line(
Expand All @@ -156,9 +156,9 @@ def process_top_line(
try:
self.status_code = int(status_code.decode("ascii", "replace"))
except UnicodeDecodeError:
pass # FIXME
pass
except ValueError:
pass # FIXME
pass
try:
self.status_phrase = status_phrase.decode("ascii", "strict")
except UnicodeDecodeError:
Expand Down

0 comments on commit 86bf370

Please sign in to comment.