Skip to content

Commit f31a574

Browse files
committed
Use type annotations from the future
1 parent 329c647 commit f31a574

5 files changed

Lines changed: 195 additions & 190 deletions

File tree

minfraud/errors.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Typed errors thrown by this library."""
22

3-
from typing import Optional
3+
from __future__ import annotations
44

55

66
class MinFraudError(RuntimeError):
@@ -22,21 +22,21 @@ class HTTPError(MinFraudError):
2222
:py:exc:`MinFraudError` and adds attributes of its own.
2323
"""
2424

25-
http_status: Optional[int]
25+
http_status: int | None
2626
"""The HTTP status code returned"""
2727

28-
uri: Optional[str]
28+
uri: str | None
2929
"""The URI queried"""
3030

31-
decoded_content: Optional[str]
31+
decoded_content: str | None
3232
"""The decoded response content"""
3333

3434
def __init__(
3535
self,
3636
message: str,
37-
http_status: Optional[int] = None,
38-
uri: Optional[str] = None,
39-
decoded_content: Optional[str] = None,
37+
http_status: int | None = None,
38+
uri: str | None = None,
39+
decoded_content: str | None = None,
4040
) -> None:
4141
"""Initialize an HTTPError instance."""
4242
super().__init__(message)

0 commit comments

Comments
 (0)