mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Don't index exceptions directly
In Python 3, exceptions don't behave as tuples of their arguments; instead of e[1] it's necessary to use e.args[1]. https://fedorahosted.org/freeipa/ticket/5623 Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
committed by
Jan Cholasta
parent
126d899321
commit
465dd9829c
@@ -1284,14 +1284,14 @@ class cli(backend.Executioner):
|
||||
except IOError as e:
|
||||
raise ValidationError(
|
||||
name=to_cli(p.cli_name),
|
||||
error='%s: %s:' % (fname, e[1])
|
||||
error='%s: %s:' % (fname, e.args[1])
|
||||
)
|
||||
elif p.stdin_if_missing:
|
||||
try:
|
||||
raw = sys.stdin.read()
|
||||
except IOError as e:
|
||||
raise ValidationError(
|
||||
name=to_cli(p.cli_name), error=e[1]
|
||||
name=to_cli(p.cli_name), error=e.args[1]
|
||||
)
|
||||
|
||||
if raw:
|
||||
|
||||
Reference in New Issue
Block a user