From 4677ea29be59effed5c2c3d470451ce0e539132d Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Tue, 14 Jul 2015 10:50:18 +0200 Subject: [PATCH] Remove tuple unpacking from except clause ipalib/plugins/hbactest.py Python 3 doesn't support tuple unpacking in except clauses. All implicit tuple unpackings have been replaced with explicit unpacking of e.args. https://fedorahosted.org/freeipa/ticket/5120 Reviewed-By: Tomas Babej Reviewed-By: Alexander Bokovoy --- ipalib/plugins/hbactest.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ipalib/plugins/hbactest.py b/ipalib/plugins/hbactest.py index 068190310..c8dedd367 100644 --- a/ipalib/plugins/hbactest.py +++ b/ipalib/plugins/hbactest.py @@ -462,13 +462,14 @@ class hbactest(Command): matched_rules.append(ipa_rule.name) if res == pyhbac.HBAC_EVAL_DENY: notmatched_rules.append(ipa_rule.name) - except pyhbac.HbacError as (code, rule_name): + except pyhbac.HbacError as e: + code, rule_name = e.args if code == pyhbac.HBAC_EVAL_ERROR: error_rules.append(rule_name) self.log.info('Native IPA HBAC rule "%s" parsing error: %s' % \ (rule_name, pyhbac.hbac_result_string(code))) - except (TypeError, IOError) as (info): - self.log.error('Native IPA HBAC module error: %s' % (info)) + except (TypeError, IOError) as info: + self.log.error('Native IPA HBAC module error: %s' % info) access_granted = len(matched_rules) > 0 else: