python/machine.py: Fix monitor address typing
authorJohn Snow <jsnow@redhat.com>
Tue, 6 Oct 2020 23:57:59 +0000 (19:57 -0400)
committerJohn Snow <jsnow@redhat.com>
Tue, 20 Oct 2020 13:37:57 +0000 (09:37 -0400)
commitc4e6023f05fe6dd14d9193814679490feac546a4
treef4c005962142ee8d8406ac51ace7a53cd8cc9d87
parent932ca4bbde5ed6c57a8ae0b9cabb6e0a1ca1047a
python/machine.py: Fix monitor address typing

Prior to this, it's difficult for mypy to intuit what the concrete type
of the monitor address is; it has difficulty inferring the type across
two variables.

Create _monitor_address as a property that always returns a valid
address to simplify static type analysis.

To preserve our ability to clean up, use a simple boolean to indicate
whether or not we should try to clean up the sock file after execution.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 20201006235817.3280413-3-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
python/qemu/machine.py