Skip to content

Commit

Permalink
fix type error, pin mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Nov 3, 2019
1 parent d245d72 commit 58fdafd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions fs/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .path import recursepath

if typing.TYPE_CHECKING:
from typing import IO, List, Optional, Text
from typing import IO, List, Optional, Text, Union
from .base import FS


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


Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ commands = coverage run -m pytest --cov-append {posargs} {toxinidir}/tests
[testenv:typecheck]
python = python37
deps =
mypy
mypy==0.740
-r {toxinidir}/testrequirements.txt
commands = make typecheck
whitelist_externals = make
Expand Down

0 comments on commit 58fdafd

Please sign in to comment.