OSDN Git Service

python/qemu/qmp: use True/False for non/blocking modes
authorJohn Snow <jsnow@redhat.com>
Thu, 14 May 2020 05:53:45 +0000 (01:53 -0400)
committerPhilippe Mathieu-Daudé <philmd@redhat.com>
Sun, 31 May 2020 16:25:31 +0000 (18:25 +0200)
The type system doesn't want integers.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200514055403.18902-15-jsnow@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
python/qemu/qmp.py

index b91c9d5..a634c4e 100644 (file)
@@ -120,14 +120,14 @@ class QEMUMonitorProtocol:
         """
 
         # Check for new events regardless and pull them into the cache:
-        self.__sock.setblocking(0)
+        self.__sock.setblocking(False)
         try:
             self.__json_read()
         except OSError as err:
             if err.errno == errno.EAGAIN:
                 # No data available
                 pass
-        self.__sock.setblocking(1)
+        self.__sock.setblocking(True)
 
         # Wait for new events, if needed.
         # if wait is 0.0, this means "no wait" and is also implicitly false.