|
24 | 24 | from collections import OrderedDict |
25 | 25 | from datetime import datetime, timedelta |
26 | 26 | from typing import ( |
| 27 | + IO, |
27 | 28 | Any, |
28 | | - BinaryIO, |
29 | 29 | ClassVar, |
30 | 30 | Dict, |
31 | 31 | Generic, |
@@ -753,7 +753,7 @@ class BaseFile: |
753 | 753 |
|
754 | 754 | @staticmethod |
755 | 755 | def _verify_hashes( |
756 | | - data: Union[bytes, BinaryIO], expected_hashes: Dict[str, str] |
| 756 | + data: Union[bytes, IO[bytes]], expected_hashes: Dict[str, str] |
757 | 757 | ) -> None: |
758 | 758 | """Verifies that the hash of 'data' matches 'expected_hashes'""" |
759 | 759 | is_bytes = isinstance(data, bytes) |
@@ -782,7 +782,7 @@ def _verify_hashes( |
782 | 782 |
|
783 | 783 | @staticmethod |
784 | 784 | def _verify_length( |
785 | | - data: Union[bytes, BinaryIO], expected_length: int |
| 785 | + data: Union[bytes, IO[bytes]], expected_length: int |
786 | 786 | ) -> None: |
787 | 787 | """Verifies that the length of 'data' matches 'expected_length'""" |
788 | 788 | if isinstance(data, bytes): |
@@ -867,7 +867,7 @@ def to_dict(self) -> Dict[str, Any]: |
867 | 867 |
|
868 | 868 | return res_dict |
869 | 869 |
|
870 | | - def verify_length_and_hashes(self, data: Union[bytes, BinaryIO]) -> None: |
| 870 | + def verify_length_and_hashes(self, data: Union[bytes, IO[bytes]]) -> None: |
871 | 871 | """Verifies that the length and hashes of "data" match expected values. |
872 | 872 |
|
873 | 873 | Args: |
@@ -1178,7 +1178,7 @@ def to_dict(self) -> Dict[str, Any]: |
1178 | 1178 | **self.unrecognized_fields, |
1179 | 1179 | } |
1180 | 1180 |
|
1181 | | - def verify_length_and_hashes(self, data: Union[bytes, BinaryIO]) -> None: |
| 1181 | + def verify_length_and_hashes(self, data: Union[bytes, IO[bytes]]) -> None: |
1182 | 1182 | """Verifies that length and hashes of "data" match expected values. |
1183 | 1183 |
|
1184 | 1184 | Args: |
|
0 commit comments