fix after mypy version update
This commit is contained in:
parent
35b91a6fa2
commit
1f9be2c236
1 changed files with 5 additions and 1 deletions
|
@ -28,7 +28,11 @@ def kopen(path: PathIsh, *args, mode: str='rt', **kwargs) -> IO[str]:
|
|||
suf = pp.suffix
|
||||
if suf in {'.xz'}:
|
||||
import lzma
|
||||
return lzma.open(pp, mode, *args, **kwargs)
|
||||
r = lzma.open(pp, mode, *args, **kwargs)
|
||||
# should only happen for binary mode?
|
||||
# file:///usr/share/doc/python3/html/library/lzma.html?highlight=lzma#lzma.open
|
||||
assert not isinstance(r, lzma.LZMAFile), r
|
||||
return r
|
||||
elif suf in {'.zip'}:
|
||||
# eh. this behaviour is a bit dodgy...
|
||||
from zipfile import ZipFile
|
||||
|
|
Loading…
Add table
Reference in a new issue