From 873cb7970568ac053b8b2f81447427362760a375 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Mon, 10 Oct 2022 16:32:50 +0100 Subject: [PATCH] Drop extra IO type properties only needed by Python 3.6 Python 3.7 is now our minimum-supported Python, and so we don't need to add these properties any more. See #2566. --- rich/_null_file.py | 13 ------------- tests/test_null_file.py | 3 --- 2 files changed, 16 deletions(-) diff --git a/rich/_null_file.py b/rich/_null_file.py index 49038bfc..5d5cebc4 100644 --- a/rich/_null_file.py +++ b/rich/_null_file.py @@ -4,19 +4,6 @@ from typing import IO, Iterable, Iterator, List, Optional, Type class NullFile(IO[str]): - # TODO: "mode", "name" and "closed" are only required for Python 3.6. - - @property - def mode(self) -> str: - return "" - - @property - def name(self) -> str: - return "NullFile" - - def closed(self) -> bool: - return False - def close(self) -> None: pass diff --git a/tests/test_null_file.py b/tests/test_null_file.py index 5f11e4f9..001c89bd 100644 --- a/tests/test_null_file.py +++ b/tests/test_null_file.py @@ -5,9 +5,6 @@ def test_null_file(): file = NullFile() with file: assert file.write("abc") == 0 - assert file.mode == "" - assert file.name == "NullFile" - assert not file.closed() assert file.close() is None assert not file.isatty() assert file.read() == ""