[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 01/10] python/aqmp: add _session_guard()
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH 01/10] python/aqmp: add _session_guard() |
Date: |
Fri, 4 Mar 2022 17:34:45 +0000 |
User-agent: |
Mutt/2.1.5 (2021-12-30) |
On Fri, Feb 25, 2022 at 03:59:39PM -0500, John Snow wrote:
> In _new_session, there's a fairly complex except clause that's used to
> give semantic errors to callers of accept() and connect(). We need to
> create a new two-step replacement for accept(), so factoring out this
> piece of logic will be useful.
>
> Bolster the comments and docstring here to try and demystify what's
> going on in this fairly delicate piece of Python magic.
>
> (If we were using Python 3.7+, this would be an @asynccontextmanager. We
> don't have that very nice piece of magic, however, so this must take an
> Awaitable to manage the Exception contexts properly. We pay the price
> for platform compatibility.)
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
> python/qemu/aqmp/protocol.py | 89 +++++++++++++++++++++++++-----------
> 1 file changed, 62 insertions(+), 27 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH 01/10] python/aqmp: add _session_guard(),
Daniel P . Berrangé <=