Skip to content

Commit caeab0e

Browse files
committed
fix mypy errors
1 parent 9b563bf commit caeab0e

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

can/io/logger.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,8 @@
77
from abc import ABC, abstractmethod
88
from datetime import datetime
99
import gzip
10-
from typing import (
11-
Any,
12-
Optional,
13-
Callable,
14-
cast,
15-
IO,
16-
Type,
17-
Tuple,
18-
)
10+
from typing import Any, Optional, Callable, TextIO, Type, Tuple, Union, cast
11+
1912
from types import TracebackType
2013

2114
from typing_extensions import Literal
@@ -103,7 +96,7 @@ def __new__( # type: ignore
10396
) from None
10497

10598
@staticmethod
106-
def compress(filename: StringPathLike) -> Tuple[str, IO[Any]]:
99+
def compress(filename: StringPathLike) -> Tuple[str, Union[str, Any]]:
107100
"""
108101
Return the suffix and io object of the decompressed file.
109102
File will automatically recompress upon close.

can/io/player.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __new__( # type: ignore
9595
@staticmethod
9696
def decompress(
9797
filename: "can.typechecking.StringPathLike",
98-
) -> typing.Tuple[str, typing.IO[typing.Any]]:
98+
) -> typing.Tuple[str, typing.Union[str, typing.Any]]:
9999
"""
100100
Return the suffix and io object of the decompressed file.
101101
"""

0 commit comments

Comments
 (0)