diff options
Diffstat (limited to 'sphinx/transforms/post_transforms/images.py')
-rw-r--r-- | sphinx/transforms/post_transforms/images.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/transforms/post_transforms/images.py b/sphinx/transforms/post_transforms/images.py index 2603e0458..f9b78837f 100644 --- a/sphinx/transforms/post_transforms/images.py +++ b/sphinx/transforms/post_transforms/images.py @@ -75,7 +75,7 @@ class ImageDownloader(BaseImageConverter): headers = {} if os.path.exists(path): - timestamp = ceil(os.stat(path).st_mtime) # type: float + timestamp: float = ceil(os.stat(path).st_mtime) headers['If-Modified-Since'] = epoch_to_rfc1123(timestamp) r = requests.get(node['uri'], headers=headers) @@ -178,7 +178,7 @@ class ImageConverter(BaseImageConverter): #: #: .. todo:: This should be refactored not to store the state without class #: variable. - available = None # type: Optional[bool] + available: Optional[bool] = None #: A conversion rules the image converter supports. #: It is represented as a list of pair of source image format (mimetype) and @@ -189,7 +189,7 @@ class ImageConverter(BaseImageConverter): #: ('image/gif', 'image/png'), #: ('application/pdf', 'image/png'), #: ] - conversion_rules = [] # type: List[Tuple[str, str]] + conversion_rules: List[Tuple[str, str]] = [] def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) |