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 /ipatests/test_xmlrpc | |
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 'ipatests/test_xmlrpc')
-rw-r--r-- | ipatests/test_xmlrpc/test_sudorule_plugin.py | 2 | ||||
-rw-r--r-- | ipatests/test_xmlrpc/xmlrpc_test.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/ipatests/test_xmlrpc/test_sudorule_plugin.py b/ipatests/test_xmlrpc/test_sudorule_plugin.py index 052578666..f654a94b5 100644 --- a/ipatests/test_xmlrpc/test_sudorule_plugin.py +++ b/ipatests/test_xmlrpc/test_sudorule_plugin.py @@ -494,7 +494,7 @@ class test_sudorule(XMLRPC_test): self.rule_name, addattr='externalhost=%s' % self.test_invalid_host ) - except errors.ValidationError, e: + except errors.ValidationError as e: assert unicode(e) == ("invalid 'externalhost': only letters, " + "numbers, '_', '-' are allowed. " + "DNS label may not start or end with '-'") diff --git a/ipatests/test_xmlrpc/xmlrpc_test.py b/ipatests/test_xmlrpc/xmlrpc_test.py index 808abae19..0db211118 100644 --- a/ipatests/test_xmlrpc/xmlrpc_test.py +++ b/ipatests/test_xmlrpc/xmlrpc_test.py @@ -311,7 +311,7 @@ class Declarative(XMLRPC_test): name = klass.__name__ try: output = api.Command[cmd](*args, **options) - except StandardError, e: + except StandardError as e: pass else: raise AssertionError( @@ -334,7 +334,7 @@ class Declarative(XMLRPC_test): e = None try: output = api.Command[cmd](*args, **options) - except StandardError, e: + except StandardError as e: pass if not expected(e, output): raise AssertionError( |