Skip to content

Commit

Permalink
Fix typecheck: TextIOBase instead of TextIO
Browse files Browse the repository at this point in the history
  • Loading branch information
tovrstra committed Jul 9, 2024
1 parent 22475e1 commit 71d6e1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion iodata/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# --
"""Utility functions module."""

from io import TextIOBase
from pathlib import Path
from typing import Optional, TextIO, Union

Expand Down Expand Up @@ -140,7 +141,7 @@ def _interpret_file_lineno(
if lineno is None:
lineno = file.lineno
return file.filename, lineno
if isinstance(file, TextIO):
if isinstance(file, TextIOBase):
return file.name, lineno
if file is None:
if lineno is not None:
Expand Down

0 comments on commit 71d6e1a

Please sign in to comment.