yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-python-futurize-f-lib2to3.fixes.fix_except.patch

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