aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2020-05-14 01:53:51 -0400
committerPhilippe Mathieu-Daudé <philmd@redhat.com>2020-05-31 18:25:31 +0200
commitde210ec53c842fa67aa10110a7a351d64f91c487 (patch)
treec1c7525c3ae291de507576704f47b90343f84554 /python
parent7af67d694e289ab116c7abeca8a5bd752fbd46d7 (diff)
python/qemu/qmp: assert sockfile is not None
In truth, if you don't do this, you'll just get a TypeError exception. Now, you'll get an AssertionError. Is this tangibly better? No. Does mypy complain less? Yes. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200514055403.18902-21-jsnow@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'python')
-rw-r--r--python/qemu/qmp.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/python/qemu/qmp.py b/python/qemu/qmp.py
index a634c4e26c..e64b6b5faa 100644
--- a/python/qemu/qmp.py
+++ b/python/qemu/qmp.py
@@ -94,6 +94,7 @@ class QEMUMonitorProtocol:
raise QMPCapabilitiesError
def __json_read(self, only_event=False):
+ assert self.__sockfile is not None
while True:
data = self.__sockfile.readline()
if not data: