diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-07-30 16:49:29 +0200 |
---|---|---|
committer | Tomas Babej <tbabej@redhat.com> | 2015-08-12 18:17:23 +0200 |
commit | 27dabb45282911e375336f75934af9dd6cc5d963 (patch) | |
tree | 3c8fe5255d60613fa9cd14d053b3688feed740c9 /contrib | |
parent | a651be3eec2a08bd2865b16b0eed767db69aab0f (diff) | |
download | freeipa-27dabb45282911e375336f75934af9dd6cc5d963.tar.gz freeipa-27dabb45282911e375336f75934af9dd6cc5d963.tar.xz freeipa-27dabb45282911e375336f75934af9dd6cc5d963.zip |
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>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/RHEL4/ipa-client-setup | 4 | ||||
-rw-r--r-- | contrib/RHEL4/ipachangeconf.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/contrib/RHEL4/ipa-client-setup b/contrib/RHEL4/ipa-client-setup index 4d1fead98..1096889eb 100644 --- a/contrib/RHEL4/ipa-client-setup +++ b/contrib/RHEL4/ipa-client-setup @@ -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 diff --git a/contrib/RHEL4/ipachangeconf.py b/contrib/RHEL4/ipachangeconf.py index ac7ecf891..de1a215b7 100644 --- a/contrib/RHEL4/ipachangeconf.py +++ b/contrib/RHEL4/ipachangeconf.py @@ -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 |