qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] scripts/qapi.py: Avoid syntax not supported by Python 2.4
@ 2013-08-20 14:50 Peter Maydell
  2013-08-20 15:43 ` Luiz Capitulino
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Maydell @ 2013-08-20 14:50 UTC (permalink / raw)
  To: qemu-devel
  Cc: Stefan Hajnoczi, Erik Rull, qemu-stable, Andreas Färber,
	Luiz Capitulino

The Python "except Foo as x" syntax was only introduced in
Python 2.6, but we aim to support Python 2.4 and later.
Use the old-style "except Foo, x" syntax instead, thus
fixing configure/compile on systems with older Python.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
I don't have an old python to test this on, but it works
OK with 2.7 and Erik said he'd tested the equivalent
change done by hand.

 scripts/qapi.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/qapi.py b/scripts/qapi.py
index 0ebea94..1069310 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -161,7 +161,7 @@ class QAPISchema:
 def parse_schema(fp):
     try:
         schema = QAPISchema(fp)
-    except QAPISchemaError as e:
+    except QAPISchemaError, e:
         print >>sys.stderr, e
         exit(1)
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] scripts/qapi.py: Avoid syntax not supported by Python 2.4
  2013-08-20 14:50 [Qemu-devel] [PATCH] scripts/qapi.py: Avoid syntax not supported by Python 2.4 Peter Maydell
@ 2013-08-20 15:43 ` Luiz Capitulino
  0 siblings, 0 replies; 4+ messages in thread
From: Luiz Capitulino @ 2013-08-20 15:43 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Stefan Hajnoczi, Erik Rull, qemu-devel, Andreas Färber,
	qemu-stable

On Tue, 20 Aug 2013 15:50:15 +0100
Peter Maydell <peter.maydell@linaro.org> wrote:

> The Python "except Foo as x" syntax was only introduced in
> Python 2.6, but we aim to support Python 2.4 and later.
> Use the old-style "except Foo, x" syntax instead, thus
> fixing configure/compile on systems with older Python.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Applied to the qmp branch, thanks.

> ---
> I don't have an old python to test this on, but it works
> OK with 2.7 and Erik said he'd tested the equivalent
> change done by hand.
> 
>  scripts/qapi.py |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/qapi.py b/scripts/qapi.py
> index 0ebea94..1069310 100644
> --- a/scripts/qapi.py
> +++ b/scripts/qapi.py
> @@ -161,7 +161,7 @@ class QAPISchema:
>  def parse_schema(fp):
>      try:
>          schema = QAPISchema(fp)
> -    except QAPISchemaError as e:
> +    except QAPISchemaError, e:
>          print >>sys.stderr, e
>          exit(1)
>  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH] scripts/qapi.py: Avoid syntax not supported by Python 2.4
@ 2014-05-20 18:29 Luiz Capitulino
  2014-05-21 11:42 ` Andreas Färber
  0 siblings, 1 reply; 4+ messages in thread
From: Luiz Capitulino @ 2014-05-20 18:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, vilanova, armbru

The Python "except Foo as x" syntax was only introduced in
Python 2.6, but we aim to support Python 2.4 and later.
Use the old-style "except Foo, x" syntax instead, thus
fixing configure/compile on systems with older Python.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 scripts/qapi.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/qapi.py b/scripts/qapi.py
index 0265b40..86e9608 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -116,7 +116,7 @@ class QAPISchema:
                     continue
                 try:
                     fobj = open(include_path, 'r')
-                except IOError as e:
+                except IOError, e:
                     raise QAPIExprError(expr_info,
                                         '%s: %s' % (e.strerror, include))
                 exprs_include = QAPISchema(fobj, include, self.include_hist,
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] scripts/qapi.py: Avoid syntax not supported by Python 2.4
  2014-05-20 18:29 Luiz Capitulino
@ 2014-05-21 11:42 ` Andreas Färber
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Färber @ 2014-05-21 11:42 UTC (permalink / raw)
  To: Luiz Capitulino, qemu-devel; +Cc: peter.maydell, vilanova, armbru

Am 20.05.2014 20:29, schrieb Luiz Capitulino:
> The Python "except Foo as x" syntax was only introduced in
> Python 2.6, but we aim to support Python 2.4 and later.
> Use the old-style "except Foo, x" syntax instead, thus
> fixing configure/compile on systems with older Python.
> 
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
>  scripts/qapi.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/qapi.py b/scripts/qapi.py
> index 0265b40..86e9608 100644
> --- a/scripts/qapi.py
> +++ b/scripts/qapi.py
> @@ -116,7 +116,7 @@ class QAPISchema:
>                      continue
>                  try:
>                      fobj = open(include_path, 'r')
> -                except IOError as e:
> +                except IOError, e:
>                      raise QAPIExprError(expr_info,
>                                          '%s: %s' % (e.strerror, include))
>                  exprs_include = QAPISchema(fobj, include, self.include_hist,

I have the same change applied locally, so

Tested-by: Andreas Färber <andreas.faerber@web.de>

Thanks,
Andreas

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-21 11:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-20 14:50 [Qemu-devel] [PATCH] scripts/qapi.py: Avoid syntax not supported by Python 2.4 Peter Maydell
2013-08-20 15:43 ` Luiz Capitulino
  -- strict thread matches above, loose matches on Subject: below --
2014-05-20 18:29 Luiz Capitulino
2014-05-21 11:42 ` Andreas Färber

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).