Skip to content

Commit 58fdafd

Browse files
committed
fix type error, pin mypy
1 parent d245d72 commit 58fdafd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

fs/tools.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from .path import recursepath
1616

1717
if typing.TYPE_CHECKING:
18-
from typing import IO, List, Optional, Text
18+
from typing import IO, List, Optional, Text, Union
1919
from .base import FS
2020

2121

@@ -52,7 +52,9 @@ def copy_file_data(src_file, dst_file, chunk_size=None):
5252
read = src_file.read
5353
write = dst_file.write
5454
# The 'or None' is so that it works with binary and text files
55-
for chunk in iter(lambda: read(_chunk_size) or None, None):
55+
for chunk in iter(
56+
lambda: read(_chunk_size) or None, None
57+
): # type: Optional[Union[bytes, str]]
5658
write(chunk)
5759

5860

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ commands = coverage run -m pytest --cov-append {posargs} {toxinidir}/tests
1010
[testenv:typecheck]
1111
python = python37
1212
deps =
13-
mypy
13+
mypy==0.740
1414
-r {toxinidir}/testrequirements.txt
1515
commands = make typecheck
1616
whitelist_externals = make

0 commit comments

Comments
 (0)