From 5ba834866580773d35537547f71e495af0171afd Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 29 Sep 2022 14:50:25 -0700 Subject: [PATCH] another attempt at lint fix --- tools/efro/debug.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/efro/debug.py b/tools/efro/debug.py index 9fce4aa7..0b9b12a3 100644 --- a/tools/efro/debug.py +++ b/tools/efro/debug.py @@ -101,7 +101,11 @@ def printfiles(file: TextIO | None = None) -> None: print('Files open by this app (not limited to Python\'s):', file=file) for i, ofile in enumerate(proc.open_files()): # Mypy doesn't know about mode apparently. - mode = ofile.mode # type: ignore + # (and can't use type: ignore because we don't require psutil + # and then mypy complains about unused ignore comment when its + # not present) + mode = getattr(ofile, 'mode') + assert isinstance(mode, str) textio = textio_ids.get(ofile.fd) textio_s = id(textio) if textio is not None else '' fileio = fileio_ids.get(ofile.fd)