]> Git Repo - qemu.git/commitdiff
python: update type hints for mypy 0.930
authorJohn Snow <[email protected]>
Mon, 10 Jan 2022 19:13:49 +0000 (14:13 -0500)
committerJohn Snow <[email protected]>
Mon, 10 Jan 2022 23:22:59 +0000 (18:22 -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 <[email protected]>
Reviewed-by: Beraldo Leal <[email protected]>
Message-id: 20220110191349.1841027[email protected]
Signed-off-by: John Snow <[email protected]>
python/qemu/qmp/qom_common.py

index a59ae1a2a1883cb4d89b0e44507c5001f44357a0..2e4c741f776240957b8a59c1a316d53e9a8ca985 100644 (file)
@@ -30,10 +30,6 @@ from typing import (
 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 @@ class QOMCommand:
         self.qmp.connect()
 
     @classmethod
-    def register(cls, subparsers: Subparsers) -> None:
+    def register(cls, subparsers: Any) -> None:
         """
         Register this command with the argument parser.
 
This page took 0.026293 seconds and 4 git commands to generate.