]> git.proxmox.com Git - qemu.git/commitdiff
tracetool: use Python 2.4-compatible exception handling syntax
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Wed, 25 Apr 2012 09:39:42 +0000 (10:39 +0100)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Tue, 1 May 2012 19:15:28 +0000 (20:15 +0100)
The newer "except <exception-type> as <exception>:" syntax is not
supported by Python 2.4, we need to use "except <exception-type>,
<exception>:".

Tested all trace backends with Python 2.4.

Reported-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
scripts/tracetool.py

index cacfd99b62328b697938706e9db4d701b4572a82..c003cf69eded3df2beadf7e9b44eb51627bee185 100755 (executable)
@@ -70,7 +70,7 @@ def main(args):
 
     try:
         opts, args = getopt.getopt(args[1:], "", long_opts)
-    except getopt.GetoptError as err:
+    except getopt.GetoptError, err:
         error_opt(str(err))
 
     check_backend = False
@@ -131,7 +131,7 @@ def main(args):
     try:
         tracetool.generate(sys.stdin, arg_format, arg_backend,
                            binary = binary, probe_prefix = probe_prefix)
-    except tracetool.TracetoolError as e:
+    except tracetool.TracetoolError, e:
         error_opt(str(e))
 
 if __name__ == "__main__":