sssd/0006-SSSDConfig-Remove-unused-exception-name.patch
2015-02-14 16:20:30 +01:00

56 lines
2.4 KiB
Diff

From b4e68a8ca2db179f37988df043efe3c6a23d572c Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn@redhat.com>
Date: Mon, 9 Feb 2015 16:46:05 +0100
Subject: [PATCH 6/9] SSSDConfig: Remove unused exception name
"except ValueError, e:" was the syntax used for what is normally written
as "except ValueError as e:" in modern Python. The old syntax is still
supported in python2 for backwards compatibility.
This means "except ValueError, KeyError:" is not equivalent to
"except (ValueError, KeyError):" but to "except ValueError as KeyError:"
and variable with name "KeyError" was not used in exception handler.
Resolves:
https://fedorahosted.org/sssd/ticket/2017
Reviewed-by: Petr Viktorin <pviktori@redhat.com>
(cherry picked from commit 1ac368d0962ef8cc83dcd642c7fec8b3cba5b6fe)
---
src/config/SSSDConfig/__init__.py.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/config/SSSDConfig/__init__.py.in b/src/config/SSSDConfig/__init__.py.in
index 500bd717fec7abcaafd5153ccca7847b91e208ad..e05c98b6a334893116747968b9ddfabce05fa981 100644
--- a/src/config/SSSDConfig/__init__.py.in
+++ b/src/config/SSSDConfig/__init__.py.in
@@ -525,7 +525,7 @@ class SSSDConfigSchema(SSSDChangeConf):
mandatory,
desc,
[subtype(split_option[DEFAULT])])
- except ValueError, KeyError:
+ except ValueError:
raise ParsingError
else:
try:
@@ -544,7 +544,7 @@ class SSSDConfigSchema(SSSDChangeConf):
mandatory,
desc,
primarytype(split_option[DEFAULT]))
- except ValueError, KeyError:
+ except ValueError:
raise ParsingError
elif optionlen > 4:
@@ -559,7 +559,7 @@ class SSSDConfigSchema(SSSDChangeConf):
else:
newvalue = subtype(x)
fixed_options.extend([newvalue])
- except ValueError, KeyError:
+ except ValueError:
raise ParsingError
else:
fixed_options.extend([x])
--
2.1.0