ae23c9
From af313514f87fa036f0813f0f4dafdfdd8f259a54 Mon Sep 17 00:00:00 2001
ae23c9
From: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Date: Mon, 25 Jun 2018 21:23:44 +0100
ae23c9
Subject: [PATCH 03/15] python: futurize -f lib2to3.fixes.fix_except
ae23c9
ae23c9
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Message-id: <20180625212346.26440-3-ehabkost@redhat.com>
ae23c9
Patchwork-id: 81050
ae23c9
O-Subject: [qemu-kvm RHEL8/virt212 PATCH 2/4] python: futurize -f lib2to3.fixes.fix_except
ae23c9
Bugzilla: 1571533
ae23c9
RH-Acked-by: Thomas Huth <thuth@redhat.com>
ae23c9
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
ae23c9
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
ae23c9
ae23c9
Convert "except X, T" to "except X as T".
ae23c9
ae23c9
This is necessary for Python 3 compatibility.
ae23c9
ae23c9
Done using:
ae23c9
ae23c9
  $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \
ae23c9
    sort -u | grep -v README.sh4)
ae23c9
  $ futurize -w -f lib2to3.fixes.fix_except $py
ae23c9
ae23c9
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
ae23c9
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Message-Id: <20180608122952.2009-10-ehabkost@redhat.com>
ae23c9
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
(cherry picked from commit bd228083f7364dd2903970ec4dc0cc55bf156104)
ae23c9
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 scripts/simpletrace.py | 2 +-
ae23c9
 1 file changed, 1 insertion(+), 1 deletion(-)
ae23c9
ae23c9
diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py
ae23c9
index 54e761f..6b46195 100755
ae23c9
--- a/scripts/simpletrace.py
ae23c9
+++ b/scripts/simpletrace.py
ae23c9
@@ -45,7 +45,7 @@ def get_record(edict, idtoname, rechdr, fobj):
ae23c9
         rec = (name, rechdr[1], rechdr[3])
ae23c9
         try:
ae23c9
             event = edict[name]
ae23c9
-        except KeyError, e:
ae23c9
+        except KeyError as e:
ae23c9
             import sys
ae23c9
             sys.stderr.write('%s event is logged but is not declared ' \
ae23c9
                              'in the trace events file, try using ' \
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9