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_ipapython | |
| 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_ipapython')
| -rw-r--r-- | ipatests/test_ipapython/test_keyring.py | 2 | ||||
| -rw-r--r-- | ipatests/test_ipapython/test_ssh.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ipatests/test_ipapython/test_keyring.py b/ipatests/test_ipapython/test_keyring.py index e92b1b465..bd876ea77 100644 --- a/ipatests/test_ipapython/test_keyring.py +++ b/ipatests/test_ipapython/test_keyring.py @@ -59,7 +59,7 @@ class test_keyring(object): # Make sure it is gone try: result = kernel_keyring.read_key(TEST_KEY) - except ValueError, e: + except ValueError as e: assert e.message == 'key %s not found' % TEST_KEY def test_02(self): diff --git a/ipatests/test_ipapython/test_ssh.py b/ipatests/test_ipapython/test_ssh.py index db136a898..913ff8e6b 100644 --- a/ipatests/test_ipapython/test_ssh.py +++ b/ipatests/test_ipapython/test_ssh.py @@ -30,7 +30,7 @@ def make_public_key_checker(pk, out): try: parsed = ssh.SSHPublicKey(pk) assert parsed.openssh() == out - except Exception, e: + except Exception as e: assert type(e) is out check_public_key.description = "Test SSH public key parsing (%s)" % repr(pk) return check_public_key |
