summaryrefslogtreecommitdiffstats
path: root/ipalib/cli.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-07-30 16:49:29 +0200
committerTomas Babej <tbabej@redhat.com>2015-08-12 18:17:23 +0200
commit27dabb45282911e375336f75934af9dd6cc5d963 (patch)
tree3c8fe5255d60613fa9cd14d053b3688feed740c9 /ipalib/cli.py
parenta651be3eec2a08bd2865b16b0eed767db69aab0f (diff)
downloadfreeipa-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 'ipalib/cli.py')
-rw-r--r--ipalib/cli.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index 4104e6482..52904eada 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -1283,7 +1283,7 @@ class cli(backend.Executioner):
f = open(fname, 'r')
raw = f.read()
f.close()
- except IOError, e:
+ except IOError as e:
raise ValidationError(
name=to_cli(p.cli_name),
error='%s: %s:' % (fname, e[1])
@@ -1291,7 +1291,7 @@ class cli(backend.Executioner):
elif p.stdin_if_missing:
try:
raw = sys.stdin.read()
- except IOError, e:
+ except IOError as e:
raise ValidationError(
name=to_cli(p.cli_name), error=e[1]
)
@@ -1341,9 +1341,9 @@ def run(api):
except KeyboardInterrupt:
print ''
api.log.info('operation aborted')
- except PublicError, e:
+ except PublicError as e:
error = e
- except StandardError, e:
+ except StandardError as e:
api.log.exception('%s: %s', e.__class__.__name__, str(e))
error = InternalError()
if error is not None: