Modernize 'except' clauses

The 'as' syntax works from Python 2 on, and Python 3 will
drop the "comma" syntax.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
This commit is contained in:
Petr Viktorin authored and Tomas Babej committed 2015-08-12 18:17:23 +02:00
1 parent a651be3eec
commit 27dabb4528
118 files changed
+661 -661

No files matched your search

+2 -2
View File
@@ -112,7 +112,7 @@ class ipaserver:
self.domain = lrealms[0].lower()
return True
except LDAPError, err:
except LDAPError as err:
#no good
root_logger.error("Ldap Error: "+str(err))
return False
@@ -289,7 +289,7 @@ def main():
{'name':'empty', 'type':'empty'}]
try:
ldapconf.newConf("/etc/ldap.conf", opts)
except Exception, e:
except Exception as e:
print "Configuration failed: " + str(e)
return 1
+1 -1
View File
@@ -435,7 +435,7 @@ class IPAChangeConf:
try:
try:
shutil.copy2(file, file+".ipabkp")
except IOError, err:
except IOError as err:
if err.errno == 2:
# The orign file did not exist
pass