summaryrefslogtreecommitdiff
path: root/sphinx/util/images.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-02-07 19:29:24 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-02-09 22:49:01 +0900
commitd25c3ad2419aa01ab0b64898ebe71bb7139928cb (patch)
tree8fd4655ec193f4bde52f75828803769d491ba734 /sphinx/util/images.py
parent84458da82889e28fc44988601a79c0c562e0e994 (diff)
downloadsphinx-git-d25c3ad2419aa01ab0b64898ebe71bb7139928cb.tar.gz
Update type annotations
Diffstat (limited to 'sphinx/util/images.py')
-rw-r--r--sphinx/util/images.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/util/images.py b/sphinx/util/images.py
index 8c32e3414..a2a31f55b 100644
--- a/sphinx/util/images.py
+++ b/sphinx/util/images.py
@@ -12,7 +12,7 @@ import base64
import imghdr
from collections import OrderedDict
from os import path
-from typing import IO, NamedTuple, Optional, Tuple
+from typing import IO, BinaryIO, NamedTuple, Optional, Tuple
import imagesize
@@ -103,7 +103,7 @@ def parse_data_uri(uri: str) -> Optional[DataURI]:
return DataURI(mimetype, charset, image_data)
-def test_svg(h: bytes, f: IO) -> Optional[str]:
+def test_svg(h: bytes, f: Optional[BinaryIO]) -> Optional[str]:
"""An additional imghdr library helper; test the header is SVG's or not."""
try:
if '<svg' in h.decode().lower():