summary refs log tree commit diff stats
path: root/python/qemu/aqmp/protocol.py
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2022-01-11 14:20:42 +0000
committerPeter Maydell <peter.maydell@linaro.org>2022-01-11 14:20:42 +0000
commit7bb1272f40bdbdebcaec1737c412dcb52e414842 (patch)
treef45c186da68f21b3350e3ef2ae1c6ff70f7ed32c /python/qemu/aqmp/protocol.py
parent64c01c7da449bcafc614b27ecf1325bb08031c84 (diff)
parent9ebfc5a583d8aa94bf1bc37c1f71559187fd809c (diff)
downloadfocaccia-qemu-7bb1272f40bdbdebcaec1737c412dcb52e414842.tar.gz
focaccia-qemu-7bb1272f40bdbdebcaec1737c412dcb52e414842.zip
Merge remote-tracking branch 'remotes/jsnow-gitlab/tags/python-pull-request' into staging
Python pull request

Fixes for the tests that broke during vacation, plus a simple syntax fix
for a python script.

# gpg: Signature made Mon 10 Jan 2022 23:24:47 GMT
# gpg:                using RSA key F9B7ABDBBCACDF95BE76CBD07DEF8106AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>" [full]
# Primary key fingerprint: FAEB 9711 A12C F475 812F  18F2 88A9 064D 1835 61EB
#      Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76  CBD0 7DEF 8106 AAFC 390E

* remotes/jsnow-gitlab/tags/python-pull-request:
  simplebench: Fix Python syntax error (reported by LGTM)
  python: update type hints for mypy 0.930
  Python/aqmp: fix type definitions for mypy 0.920
  python/aqmp: use absolute import statement

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'python/qemu/aqmp/protocol.py')
-rw-r--r--python/qemu/aqmp/protocol.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/qemu/aqmp/protocol.py b/python/qemu/aqmp/protocol.py
index 5190b33b13..c4fbe35a0e 100644
--- a/python/qemu/aqmp/protocol.py
+++ b/python/qemu/aqmp/protocol.py
@@ -43,8 +43,8 @@ from .util import (
 
 
 T = TypeVar('T')
+_U = TypeVar('_U')
 _TaskFN = Callable[[], Awaitable[None]]  # aka ``async def func() -> None``
-_FutureT = TypeVar('_FutureT', bound=Optional['asyncio.Future[Any]'])
 
 
 class Runstate(Enum):
@@ -591,7 +591,8 @@ class AsyncProtocol(Generic[T]):
         """
         Fully reset this object to a clean state and return to `IDLE`.
         """
-        def _paranoid_task_erase(task: _FutureT) -> Optional[_FutureT]:
+        def _paranoid_task_erase(task: Optional['asyncio.Future[_U]']
+                                 ) -> Optional['asyncio.Future[_U]']:
             # Help to erase a task, ENSURING it is fully quiesced first.
             assert (task is None) or task.done()
             return None if (task and task.done()) else task