aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2023-11-13 07:15:30 -0500
committerStefan Hajnoczi <stefanha@redhat.com>2023-11-13 07:15:30 -0500
commit05fa22770a7d357342b32203c5b56827219cad00 (patch)
tree382ca997621a6cf4d71c448d648c5bd89adb7cc8
parentc86a59fd349da324dc79c3df7ab88b3de101b9ea (diff)
parent5c24c3e2f3b22f1b77d556a14dd3bb8deed1f976 (diff)
downloadqemu-05fa22770a7d357342b32203c5b56827219cad00.zip
qemu-05fa22770a7d357342b32203c5b56827219cad00.tar.gz
qemu-05fa22770a7d357342b32203c5b56827219cad00.tar.bz2
Merge tag 'pull-qapi-2023-11-13' of https://repo.or.cz/qemu/armbru into staging
QAPI patches patches for 2023-11-13 # -----BEGIN PGP SIGNATURE----- # # iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmVR7j4SHGFybWJydUBy # ZWRoYXQuY29tAAoJEDhwtADrkYZTmT0P/imN9c6xnkx8Kff0iEaT88N8YUHEu5gt # ECiQtfpbU8y8itIrWpuXWk7HUC1Jp397vKgUhmmr5Im32vx1waUGz/zxdBiitw0a # 2McXfD6Lbz3LN+q002Vq0QjP3tMeoc8DoP/CagmdXniGrxyJSs/oIsUAdqZnymug # ZREYRUlbrgJ8XA06n9qIaCGpiihBLl2XBbx4SV9JWle/9vKpII9EBrWNXTcCkde3 # W6gHEKgGAKa1NGYMJtOncanpnzVP0qoLmb3jmiR9tpj3YBB/5LP9l4O11DTC+PQ5 # nn+OmtmjuKE2a2C79Y8VCbRPR6MPSDDbuWwu7Q+A7vXi/1gnkMeXH+A6jE0d3y+p # PWKqBK65U+yS0IwiUGpMpcGo2WtZiBLzp3ragt+gzi3gV5GvEvPv0uvcEd66in95 # +M2RoVhkbi+e03mF+vDldvbwBYPwlNdgAX/ly7SR76YZybSMK0Jkp7yfvxN35LJc # kgCo0CY9kAYYUgPUJMiPhaxSfRVk738Qex7QCvFwDiZE8l4XEwoT1PRO0fs8G5aI # /Yz7hhjkaLw+i+k/tCVCVe+hOgMxxVUz/gZzV4+yrfQNxz41v4WqCfE8a+m6RROo # TaceVJPKqsyoJ2zmS+CpEPFWkWXEQSQ14yu2wdF8wMyKEWDS4yhRG78rnYC2/ZhC # zullCL7QfFbf # =bGOD # -----END PGP SIGNATURE----- # gpg: Signature made Mon 13 Nov 2023 04:37:02 EST # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * tag 'pull-qapi-2023-11-13' of https://repo.or.cz/qemu/armbru: tests/qapi-schema: Tidy up pylint warnings and advice sphinx/qapidoc: Tidy up pylint warning raise-missing-from qapi: Fix QAPISchemaEntity.__repr__() Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--docs/sphinx/qapidoc.py2
-rw-r--r--scripts/qapi/schema.py3
-rwxr-xr-xtests/qapi-schema/test-qapi.py9
3 files changed, 7 insertions, 7 deletions
diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py
index 8f3b999..658c288 100644
--- a/docs/sphinx/qapidoc.py
+++ b/docs/sphinx/qapidoc.py
@@ -515,7 +515,7 @@ class QAPIDocDirective(Directive):
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
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index d739e55..6a83695 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -76,7 +76,8 @@ class QAPISchemaEntity:
def __repr__(self):
if self.name is None:
return "<%s at 0x%x>" % (type(self).__name__, id(self))
- return "<%s:%s at 0x%x>" % type(self).__name__, self.name, id(self)
+ return "<%s:%s at 0x%x>" % (type(self).__name__, self.name,
+ id(self))
def c_name(self):
return c_name(self.name)
diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
index d58c31f..14f7b62 100755
--- a/tests/qapi-schema/test-qapi.py
+++ b/tests/qapi-schema/test-qapi.py
@@ -136,12 +136,11 @@ def test_frontend(fname):
def open_test_result(dir_name, file_name, update):
mode = 'r+' if update else 'r'
try:
- fp = open(os.path.join(dir_name, file_name), mode)
+ return open(os.path.join(dir_name, file_name), mode, encoding='utf-8')
except FileNotFoundError:
if not update:
raise
- fp = open(os.path.join(dir_name, file_name), 'w+')
- return fp
+ return open(os.path.join(dir_name, file_name), 'w+', encoding='utf-8')
def test_and_diff(test_name, dir_name, update):
@@ -218,9 +217,9 @@ def main(argv):
test_name = os.path.splitext(base_name)[0]
status |= test_and_diff(test_name, dir_name, args.update)
- exit(status)
+ sys.exit(status)
if __name__ == '__main__':
main(sys.argv)
- exit(0)
+ sys.exit(0)