Skip to content

Commit c93a2e0

Browse files
karldinghardbyte
authored andcommitted
Fix typing annotation for LogReader constructor
A bug was introduced sometime during refactoring of types in the helper typechecking.py file, when PathLike was renamed to StringPathLike. This results in mypy complaining that it can't find the PathLike type: error: Name 'can.typechecking.PathLike' is not defined As such, this changes the accepted type for the LogReader constructor to be a typechecking.StringPathLike.
1 parent 7bf3928 commit c93a2e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

can/io/player.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class LogReader(BaseIOHandler):
4545
"""
4646

4747
@staticmethod
48-
def __new__(cls, filename: "can.typechecking.PathLike", *args, **kwargs):
48+
def __new__(cls, filename: "can.typechecking.StringPathLike", *args, **kwargs):
4949
"""
5050
:param filename: the filename/path of the file to read from
5151
:raises ValueError: if the filename's suffix is of an unknown file type

0 commit comments

Comments
 (0)