Skip to content
Snippets Groups Projects
Commit de210ec5 authored by John Snow's avatar John Snow Committed by Philippe Mathieu-Daudé
Browse files

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: default avatarJohn Snow <jsnow@redhat.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200514055403.18902-21-jsnow@redhat.com>
Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
parent 7af67d69
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,7 @@ def __negotiate_capabilities(self):
raise QMPCapabilitiesError
def __json_read(self, only_event=False):
assert self.__sockfile is not None
while True:
data = self.__sockfile.readline()
if not data:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment