From 71d6e1ab5ad00c68f4f8a548d9b164bf0e400022 Mon Sep 17 00:00:00 2001 From: Toon Verstraelen Date: Tue, 9 Jul 2024 07:29:57 +0200 Subject: [PATCH] Fix typecheck: TextIOBase instead of TextIO --- iodata/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iodata/utils.py b/iodata/utils.py index 54b61f83..3f92f740 100644 --- a/iodata/utils.py +++ b/iodata/utils.py @@ -18,6 +18,7 @@ # -- """Utility functions module.""" +from io import TextIOBase from pathlib import Path from typing import Optional, TextIO, Union @@ -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: