mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-20 16:42:04 -06:00
scripts/qmp: Use Python 2.6 "except E as ..." syntax
PEP 8 calls for it, because it's forward compatible with Python 3.
Supported since Python 2.6, which we require (commit fec2103
).
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <1450425164-24969-3-git-send-email-armbru@redhat.com>
This commit is contained in:
parent
291928a80f
commit
cf6c63456b
4 changed files with 6 additions and 6 deletions
|
@ -92,7 +92,7 @@ class QEMUMonitorProtocol:
|
|||
self.__sock.setblocking(0)
|
||||
try:
|
||||
self.__json_read()
|
||||
except socket.error, err:
|
||||
except socket.error as err:
|
||||
if err[0] == errno.EAGAIN:
|
||||
# No data available
|
||||
pass
|
||||
|
@ -150,7 +150,7 @@ class QEMUMonitorProtocol:
|
|||
"""
|
||||
try:
|
||||
self.__sock.sendall(json.dumps(qmp_cmd))
|
||||
except socket.error, err:
|
||||
except socket.error as err:
|
||||
if err[0] == errno.EPIPE:
|
||||
return
|
||||
raise socket.error(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue