From: "Juraj Linkeš" <juraj.linkes@pantheon.tech>
To: lijuan.tu@intel.com, ohilyard@iol.unh.edu
Cc: dts@dpdk.org, "Juraj Linkeš" <juraj.linkes@pantheon.tech>
Subject: [PATCH v1] dep/QMP: fix pylama errors
Date: Mon, 6 Dec 2021 13:29:07 +0100 [thread overview]
Message-ID: <1638793747-3143-1-git-send-email-juraj.linkes@pantheon.tech> (raw)
Pylama found the following errors:
dep/QMP/qmp.py:114: [E] E1136 Value 'err' is unsubscriptable [pylint]
dep/QMP/qmp.py:153: [E] E1136 Value 'err' is unsubscriptable [pylint]
dep/QMP/qmp.py:173: [E] E1136 Value 'err' is unsubscriptable [pylint]
- replace the deprecated Exception and fix errno
Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
Lijuan, please add additional people to review if needed.
---
dep/QMP/qmp.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/dep/QMP/qmp.py b/dep/QMP/qmp.py
index 3fd5f1b2..63d3117d 100755
--- a/dep/QMP/qmp.py
+++ b/dep/QMP/qmp.py
@@ -1,5 +1,5 @@
# QEMU Monitor Protocol Python class
-#
+#
# Copyright (C) 2009, 2010 Red Hat Inc.
#
# Authors:
@@ -110,8 +110,8 @@ class QEMUMonitorProtocol:
"""
try:
self.__sock.sendall(str.encode(json.dumps(qmp_cmd)))
- except socket.error as err:
- if err[0] == errno.EPIPE:
+ except OSError as err:
+ if err.errno == errno.EPIPE:
return
raise socket.error(err)
return self.__json_read()
@@ -149,8 +149,8 @@ class QEMUMonitorProtocol:
self.__sock.setblocking(0)
try:
self.__json_read()
- except socket.error as err:
- if err[0] == errno.EAGAIN:
+ except OSError as err:
+ if err.errno == errno.EAGAIN:
# No data available
pass
self.__sock.setblocking(1)
@@ -169,8 +169,8 @@ class QEMUMonitorProtocol:
self.__sock.setblocking(0)
try:
self.__json_read()
- except socket.error as err:
- if err[0] == errno.EAGAIN:
+ except OSError as err:
+ if err.errno == errno.EAGAIN:
# No data available
pass
self.__sock.setblocking(1)
--
2.20.1
next reply other threads:[~2021-12-06 12:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-06 12:29 Juraj Linkeš [this message]
2022-01-14 8:10 ` Tu, Lijuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1638793747-3143-1-git-send-email-juraj.linkes@pantheon.tech \
--to=juraj.linkes@pantheon.tech \
--cc=dts@dpdk.org \
--cc=lijuan.tu@intel.com \
--cc=ohilyard@iol.unh.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).