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
2015-07-30 16:49:29 +02:00
committed by Tomas Babej
parent a651be3eec
commit 27dabb4528
118 changed files with 661 additions and 661 deletions

View File

@@ -442,7 +442,7 @@ class DNSKeySyncInstance(service.Service):
self.admin_conn.modify_s(dns_group, mod)
except ldap.TYPE_OR_VALUE_EXISTS:
pass
except Exception, e:
except Exception as e:
self.logger.critical("Could not modify principal's %s entry: %s"
% (dnssynckey_principal_dn, str(e)))
raise
@@ -456,7 +456,7 @@ class DNSKeySyncInstance(service.Service):
(ldap.MOD_REPLACE, 'nsLookThroughLimit', '-1')]
try:
self.admin_conn.modify_s(dnssynckey_principal_dn, mod)
except Exception, e:
except Exception as e:
self.logger.critical("Could not set principal's %s LDAP limits: %s"
% (dnssynckey_principal_dn, str(e)))
raise
@@ -485,7 +485,7 @@ class DNSKeySyncInstance(service.Service):
for f in [paths.SYSCONFIG_NAMED]:
try:
self.fstore.restore_file(f)
except ValueError, error:
except ValueError as error:
self.logger.debug(error)
pass