python/machine.py: fix _popen access
commit9223fda464690b83a2b1f1487163f50602454c2e
authorJohn Snow <jsnow@redhat.com>
Tue, 6 Oct 2020 23:58:05 +0000 (6 19:58 -0400)
committerJohn Snow <jsnow@redhat.com>
Tue, 20 Oct 2020 13:37:57 +0000 (20 09:37 -0400)
tree0bae4863fc931796bcdf6796c593e2e18a7255a5
parentbe1183e52f49cd0f9c1a855afe4c4a5455f966d1
python/machine.py: fix _popen access

As always, Optional[T] causes problems with unchecked access. Add a
helper that asserts the pipe is present before we attempt to talk with
it.

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