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

@@ -463,7 +463,7 @@ class Command(HasParam):
try:
value = values.get(p.name)
values[p.name] = p(value, **values)
except InvocationError, e:
except InvocationError as e:
errors[p.name] = str(e)
return dict(
values=values,
@@ -591,7 +591,7 @@ class Command(HasParam):
try:
return param(raw, **kw)
except (ValidationError, ConversionError), e:
except (ValidationError, ConversionError) as e:
# Display error and prompt again
self.Backend.textui.print_prompt_attribute_error(unicode(label),
unicode(e.error))