[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 03/31] python: update type hints for mypy 0.930
From: |
John Snow |
Subject: |
[PATCH v3 03/31] python: update type hints for mypy 0.930 |
Date: |
Mon, 10 Jan 2022 18:28:42 -0500 |
Mypy 0.930, released Dec 22, changes the way argparse objects are
considered. Crafting a definition that works under Python 3.6 and an
older mypy alongside newer versions simultaneously is ... difficult,
so... eh. Stub it out with an 'Any' definition to get the CI moving
again.
Oh well.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 20220110191349.1841027-4-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
---
python/qemu/qmp/qom_common.py | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/python/qemu/qmp/qom_common.py b/python/qemu/qmp/qom_common.py
index a59ae1a2a1..2e4c741f77 100644
--- a/python/qemu/qmp/qom_common.py
+++ b/python/qemu/qmp/qom_common.py
@@ -30,10 +30,6 @@
from . import QEMUMonitorProtocol, QMPError
-# The following is needed only for a type alias.
-Subparsers = argparse._SubParsersAction # pylint: disable=protected-access
-
-
class ObjectPropertyInfo:
"""
Represents the return type from e.g. qom-list.
@@ -89,7 +85,7 @@ def __init__(self, args: argparse.Namespace):
self.qmp.connect()
@classmethod
- def register(cls, subparsers: Subparsers) -> None:
+ def register(cls, subparsers: Any) -> None:
"""
Register this command with the argument parser.
--
2.31.1
- [PATCH v3 00/31] Python: delete synchronous qemu.qmp package, John Snow, 2022/01/10
- [PATCH v3 01/31] python/aqmp: use absolute import statement, John Snow, 2022/01/10
- [PATCH v3 02/31] Python/aqmp: fix type definitions for mypy 0.920, John Snow, 2022/01/10
- [PATCH v3 03/31] python: update type hints for mypy 0.930,
John Snow <=
- [PATCH v3 04/31] simplebench: Fix Python syntax error (reported by LGTM), John Snow, 2022/01/10
- [PATCH v3 05/31] python/aqmp: fix docstring typo, John Snow, 2022/01/10
- [PATCH v3 07/31] python/aqmp: handle asyncio.TimeoutError on execute(), John Snow, 2022/01/10
- [PATCH v3 06/31] python/aqmp: add __del__ method to legacy interface, John Snow, 2022/01/10
- [PATCH v3 09/31] python/aqmp: add SocketAddrT to package root, John Snow, 2022/01/10
- [PATCH v3 08/31] python/aqmp: copy type definitions from qmp, John Snow, 2022/01/10
- [PATCH v3 11/31] python/qemu-ga-client: don't use deprecated CLI syntax in usage comment, John Snow, 2022/01/10
- [PATCH v3 12/31] python/qmp: switch qemu-ga-client to AQMP, John Snow, 2022/01/10