Package: kitchen / 1.2.4-2

explicit_Exception_catching Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 3500c7f4705840ba79b1b8f97ba48f95fc75325b Mon Sep 17 00:00:00 2001
From: Simon Chopin <chopin.simon@gmail.com>
Date: Tue, 30 Apr 2013 18:27:15 +0200
Subject: Make kitchen.text.converters.exception_to_* not swallow

 general errors such as KeyboardInterrupt
Bug: https://fedorahosted.org/kitchen/ticket/9

Patch-Name: explicit_Exception_catching
---
 kitchen2/kitchen/text/converters.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kitchen2/kitchen/text/converters.py b/kitchen2/kitchen/text/converters.py
index eb518cb..d925313 100644
--- a/kitchen2/kitchen/text/converters.py
+++ b/kitchen2/kitchen/text/converters.py
@@ -499,7 +499,7 @@ def exception_to_unicode(exc, converters=EXCEPTION_CONVERTERS):
     for func in converters:
         try:
             msg = func(exc)
-        except:
+        except Exception:
             pass
         else:
             break
@@ -531,7 +531,7 @@ def exception_to_bytes(exc, converters=EXCEPTION_CONVERTERS):
     for func in converters:
         try:
             msg = func(exc)
-        except:
+        except Exception:
             pass
         else:
             break