summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArfrever <arfrever@gentoo.org>2011-12-30 11:49:57 -0500
committerAnthony G. Basile <blueness@gentoo.org>2011-12-30 11:50:11 -0500
commitab63707059e517154e3cd5b0f704384e8c74cea0 (patch)
tree3e7a277739c650d94a3d299e0052828d28030ea3 /WebappConfig/permissions.py
parentDon't set unused exception variables. (diff)
downloadwebapp-config-ab63707059e517154e3cd5b0f704384e8c74cea0.tar.gz
webapp-config-ab63707059e517154e3cd5b0f704384e8c74cea0.tar.bz2
webapp-config-ab63707059e517154e3cd5b0f704384e8c74cea0.zip
Update syntax of setting exceptions for compatibility with Python 3.
Reported-By: Arfrever <arfrever@gentoo.org> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'WebappConfig/permissions.py')
-rw-r--r--WebappConfig/permissions.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/WebappConfig/permissions.py b/WebappConfig/permissions.py
index 64d5f3d..966c610 100644
--- a/WebappConfig/permissions.py
+++ b/WebappConfig/permissions.py
@@ -217,14 +217,14 @@ def get_group(group):
try:
# Try to match the integer to a group id
gid = grp.getgrgid(ngroup)[2]
- except KeyError, e:
+ except KeyError as e:
pass
if gid == -1:
# No success yet. Try to match to the group name
try:
gid = grp.getgrnam(str(group))[2]
- except KeyError, e:
+ except KeyError as e:
raise KeyError('The given group "' + str(group)
+ '" does not exist!')
@@ -265,14 +265,14 @@ def get_user(user):
try:
# Try to match the integer to a user id
uid = pwd.getpwuid(nuser)[2]
- except KeyError, e:
+ except KeyError as e:
pass
if uid == -1:
# No success yet. Try to match to the user name
try:
uid = pwd.getpwnam(str(user))[2]
- except KeyError, e:
+ except KeyError as e:
raise KeyError('The given user "' + str(user)
+ '" does not exist!')
return uid