From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, qemu-block@nongnu.org,
mdroth@linux.vnet.ibm.com, stefanha@redhat.com
Subject: [Qemu-devel] [PATCH 1/4] qapi: Use Python 2.6 "except E as ..." syntax
Date: Thu, 17 Dec 2015 11:06:28 +0100 [thread overview]
Message-ID: <1450346791-25562-2-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1450346791-25562-1-git-send-email-armbru@redhat.com>
PEP 8 calls for it, because it's forward compatibile with Python 3.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
scripts/qapi.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 7c50cc4..ba7151b 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -152,7 +152,7 @@ class QAPISchemaParser(object):
continue
try:
fobj = open(incl_abs_fname, 'r')
- except IOError, e:
+ except IOError as e:
raise QAPIExprError(expr_info,
'%s: %s' % (e.strerror, include))
exprs_include = QAPISchemaParser(fobj, previously_included,
@@ -1148,7 +1148,7 @@ class QAPISchema(object):
self._predefining = False
self._def_exprs()
self.check()
- except (QAPISchemaError, QAPIExprError), err:
+ except (QAPISchemaError, QAPIExprError) as err:
print >>sys.stderr, err
exit(1)
@@ -1639,7 +1639,7 @@ def parse_command_line(extra_options="", extra_long_options=[]):
"chp:o:" + extra_options,
["source", "header", "prefix=",
"output-dir="] + extra_long_options)
- except getopt.GetoptError, err:
+ except getopt.GetoptError as err:
print >>sys.stderr, "%s: %s" % (sys.argv[0], str(err))
sys.exit(1)
@@ -1693,7 +1693,7 @@ def open_output(output_dir, do_c, do_h, prefix, c_file, h_file,
if output_dir:
try:
os.makedirs(output_dir)
- except os.error, e:
+ except os.error as e:
if e.errno != errno.EEXIST:
raise
--
2.4.3
next prev parent reply other threads:[~2015-12-17 10:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 10:06 [Qemu-devel] [PATCH 0/4] Use Python 2.6 "except E as ..." syntax Markus Armbruster
2015-12-17 10:06 ` Markus Armbruster [this message]
2015-12-17 17:26 ` [Qemu-devel] [PATCH 1/4] qapi: " Eric Blake
2015-12-17 18:35 ` Markus Armbruster
2015-12-17 19:58 ` Eric Blake
2015-12-17 20:00 ` Peter Maydell
2015-12-17 10:06 ` [Qemu-devel] [PATCH 2/4] scripts/qmp: " Markus Armbruster
2015-12-17 17:27 ` Eric Blake
2015-12-17 10:06 ` [Qemu-devel] [PATCH 3/4] Revert "tracetool: use Python 2.4-compatible exception handling syntax" Markus Armbruster
2015-12-17 17:28 ` Eric Blake
2015-12-17 18:37 ` Markus Armbruster
2015-12-17 19:59 ` Eric Blake
2015-12-17 10:06 ` [Qemu-devel] [PATCH 4/4] tests: Use Python 2.6 "except E as ..." syntax Markus Armbruster
2015-12-17 17:29 ` Eric Blake
2015-12-18 5:10 ` [Qemu-devel] [PATCH 0/4] " 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=1450346791-25562-2-git-send-email-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-block@nongnu.org \
--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).