diff options
| author | John Snow <jsnow@redhat.com> | 2025-08-26 13:04:50 -0400 |
|---|---|---|
| committer | John Snow <jsnow@redhat.com> | 2025-09-15 14:36:01 -0400 |
| commit | f414048e32262830e06d50240b2f15b6e5857efe (patch) | |
| tree | 3d2301e63c94e439617bfb9accc9c788ca36c2fd /python/qemu/qmp/util.py | |
| parent | 85f223e5b031eb8ab63fbca314a4fb296a3a2632 (diff) | |
| download | focaccia-qemu-f414048e32262830e06d50240b2f15b6e5857efe.tar.gz focaccia-qemu-f414048e32262830e06d50240b2f15b6e5857efe.zip | |
python: synchronize qemu.qmp documentation
This patch collects comments and documentation changes from many commits in the python-qemu-qmp repository; bringing the qemu.git copy in bit-identical alignment with the standalone library *except* for several copyright messages that reference the "LICENSE" file which is, for QEMU, named "COPYING" instead and are therefore left unchanged. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to '')
| -rw-r--r-- | python/qemu/qmp/util.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/python/qemu/qmp/util.py b/python/qemu/qmp/util.py index 47ec39a8b5..a8229e5524 100644 --- a/python/qemu/qmp/util.py +++ b/python/qemu/qmp/util.py @@ -49,7 +49,7 @@ def get_or_create_event_loop() -> asyncio.AbstractEventLoop: async def flush(writer: asyncio.StreamWriter) -> None: """ - Utility function to ensure a StreamWriter is *fully* drained. + Utility function to ensure an `asyncio.StreamWriter` is *fully* drained. `asyncio.StreamWriter.drain` only promises we will return to below the "high-water mark". This function ensures we flush the entire @@ -89,7 +89,7 @@ def bottom_half(func: T) -> T: These methods do not, in general, have the ability to directly report information to a caller’s context and will usually be - collected as a Task result instead. + collected as an `asyncio.Task` result instead. They must not call upper-half functions directly. """ @@ -105,8 +105,11 @@ def exception_summary(exc: BaseException) -> str: """ Return a summary string of an arbitrary exception. - It will be of the form "ExceptionType: Error Message", if the error + It will be of the form "ExceptionType: Error Message" if the error string is non-empty, and just "ExceptionType" otherwise. + + This code is based on CPython's implementation of + `traceback.TracebackException.format_exception_only`. """ name = type(exc).__qualname__ smod = type(exc).__module__ |