From e7874a50ff3f5b20fb46f36958ad88334e4d55cd Mon Sep 17 00:00:00 2001 From: John Snow Date: Wed, 25 May 2022 20:09:13 -0400 Subject: python: update for mypy 0.950 typeshed (included in mypy) recently updated to improve the typing for WriteTransport objects. I was working around this, but now there's a version where I shouldn't work around it. Unfortunately this creates some minor ugliness if I want to support both pre- and post-0.950 versions. For now, for my sanity, just disable the unused-ignores warning. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini Message-Id: <20220526000921.1581503-2-jsnow@redhat.com> Signed-off-by: Paolo Bonzini --- python/qemu/qmp/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'python/qemu') diff --git a/python/qemu/qmp/util.py b/python/qemu/qmp/util.py index eaa5fc7..ca6225e 100644 --- a/python/qemu/qmp/util.py +++ b/python/qemu/qmp/util.py @@ -40,7 +40,9 @@ async def flush(writer: asyncio.StreamWriter) -> None: drain. The flow control limits are restored after the call is completed. """ - transport = cast(asyncio.WriteTransport, writer.transport) + transport = cast( # type: ignore[redundant-cast] + asyncio.WriteTransport, writer.transport + ) # https://github.com/python/typeshed/issues/5779 low, high = transport.get_write_buffer_limits() # type: ignore -- cgit v1.1