mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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:
committed by
Tomas Babej
parent
a651be3eec
commit
27dabb4528
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user