summaryrefslogtreecommitdiffstats
path: root/pykolab/plugins/recipientpolicy/__init__.py
diff options
context:
space:
mode:
authorChristoph Erhardt <kolab@sicherha.de>2021-06-04 16:53:52 +0200
committerChristoph Erhardt <kolab@sicherha.de>2022-01-10 20:46:43 +0100
commit991255eaa314b51e2dd586460311d4633a56eb86 (patch)
treee3e711046511d69fabdac2c67e66df4834a1e763 /pykolab/plugins/recipientpolicy/__init__.py
parentd0579b7e5da331576b80b9d35eb62994075bc939 (diff)
downloadpykolab-991255eaa314b51e2dd586460311d4633a56eb86.tar.gz
[Python 3] Use new exception syntax
Summary: The new syntax was introduced in Python 2.6; the old syntax was deprecated in Python 3.0. Reviewers: machniak, mollekopf Reviewed By: mollekopf Differential Revision: https://git.kolab.org/D3232
Diffstat (limited to 'pykolab/plugins/recipientpolicy/__init__.py')
-rw-r--r--pykolab/plugins/recipientpolicy/__init__.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pykolab/plugins/recipientpolicy/__init__.py b/pykolab/plugins/recipientpolicy/__init__.py
index 23ba863..aab2a5e 100644
--- a/pykolab/plugins/recipientpolicy/__init__.py
+++ b/pykolab/plugins/recipientpolicy/__init__.py
@@ -75,7 +75,7 @@ class KolabRecipientpolicy(object):
mail = utils.translate(mail, user_attrs['preferredlanguage'])
mail = mail.lower()
return mail
- except KeyError, e:
+ except KeyError:
log.warning(_("Attribute substitution for 'mail' failed in Recipient Policy"))
if user_attrs.has_key('mail'):
return user_attrs['mail']
@@ -112,7 +112,7 @@ class KolabRecipientpolicy(object):
try:
exec("alternative_mail_routines = %s" % kw['secondary_mail'])
- except Exception, e:
+ except Exception:
log.error(_("Could not parse the alternative mail routines"))
alternative_mail = []
@@ -123,7 +123,7 @@ class KolabRecipientpolicy(object):
for attr in [ 'givenname', 'sn', 'surname' ]:
try:
user_attrs[attr] = utils.translate(user_attrs[attr], user_attrs['preferredlanguage'])
- except Exception, errmsg:
+ except Exception:
log.error(_("An error occurred in composing the secondary mail attribute for entry %r") % (user_attrs['id']))
if conf.debuglevel > 8:
import traceback
@@ -138,7 +138,7 @@ class KolabRecipientpolicy(object):
log.debug(_("Appending additional mail address: %s") % (retval), level=8)
alternative_mail.append(retval)
- except Exception, errmsg:
+ except Exception as errmsg:
log.error(_("Policy for secondary email address failed: %r") % (errmsg))
if conf.debuglevel > 8:
import traceback
@@ -153,7 +153,7 @@ class KolabRecipientpolicy(object):
log.debug(_("Appending additional mail address: %s") % (retval), level=8)
alternative_mail.append(retval)
- except KeyError, e:
+ except KeyError:
log.warning(_("Attribute substitution for 'alternative_mail' failed in Recipient Policy"))
alternative_mail = utils.normalize(alternative_mail)