mirror of https://github.com/Textualize/rich.git
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.
This commit is contained in:
parent
419265ba3f
commit
873cb79705
|
@ -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
|
||||
|
||||
|
|
|
@ -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() == ""
|
||||
|
|
Loading…
Reference in New Issue