Skip to content

Commit e975fa6

Browse files
authored
fix mypy (#180)
1 parent 492d8cd commit e975fa6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

exifread/heic.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# gives us position and size information.
1212

1313
import struct
14-
from typing import List, Dict, Callable, BinaryIO, Optional
14+
from typing import Any, List, Dict, Callable, BinaryIO, Optional
1515

1616
from exifread.exif_log import get_logger
1717

@@ -157,7 +157,7 @@ def expect_parse(self, name: str) -> Box:
157157
return self.parse_box(box)
158158
self.skip(box)
159159

160-
def get_parser(self, box: Box) -> Callable:
160+
def get_parser(self, box: Box) -> Optional[Callable[[Box], Any]]:
161161
defs = {
162162
'ftyp': self._parse_ftyp,
163163
'meta': self._parse_meta,
@@ -169,7 +169,8 @@ def get_parser(self, box: Box) -> Callable:
169169

170170
def parse_box(self, box: Box) -> Box:
171171
probe = self.get_parser(box)
172-
probe(box)
172+
if probe is not None:
173+
probe(box)
173174
# in case anything is left unread
174175
self.file_handle.seek(box.after)
175176
return box

0 commit comments

Comments
 (0)