summaryrefslogtreecommitdiff
path: root/sphinx/util/images.py
diff options
context:
space:
mode:
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():