From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: stefanha@redhat.com, John Snow <jsnow@redhat.com>
Subject: [PULL 2/3] sphinx/qapidoc: Tidy up pylint warning raise-missing-from
Date: Mon, 13 Nov 2023 11:34:30 +0100 [thread overview]
Message-ID: <20231113103431.913394-3-armbru@redhat.com> (raw)
In-Reply-To: <20231113103431.913394-1-armbru@redhat.com>
Pylint advises:
docs/sphinx/qapidoc.py:518:12: W0707: Consider explicitly re-raising using 'raise ExtensionError(str(err)) from err' (raise-missing-from)
>From its manual:
Python's exception chaining shows the traceback of the current
exception, but also of the original exception. When you raise a
new exception after another exception was caught it's likely that
the second exception is a friendly re-wrapping of the first
exception. In such cases `raise from` provides a better link
between the two tracebacks in the final error.
Makes sense, so do it.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20231025092159.1782638-2-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
---
docs/sphinx/qapidoc.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py
index 8f3b9997a1..658c288f8f 100644
--- a/docs/sphinx/qapidoc.py
+++ b/docs/sphinx/qapidoc.py
@@ -515,7 +515,7 @@ def run(self):
except QAPIError as err:
# Launder QAPI parse errors into Sphinx extension errors
# so they are displayed nicely to the user
- raise ExtensionError(str(err))
+ raise ExtensionError(str(err)) from err
def do_parse(self, rstlist, node):
"""Parse rST source lines and add them to the specified node
--
2.41.0
next prev parent reply other threads:[~2023-11-13 10:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-13 10:34 [PULL 0/3] QAPI patches patches for 2023-11-13 Markus Armbruster
2023-11-13 10:34 ` [PULL 1/3] qapi: Fix QAPISchemaEntity.__repr__() Markus Armbruster
2023-11-13 10:34 ` Markus Armbruster [this message]
2023-11-13 10:34 ` [PULL 3/3] tests/qapi-schema: Tidy up pylint warnings and advice Markus Armbruster
2023-11-13 19:27 ` [PULL 0/3] QAPI patches patches for 2023-11-13 Stefan Hajnoczi
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=20231113103431.913394-3-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=jsnow@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).