From 4822336f4633cbce55f2e998afd367c2ecf85497 Mon Sep 17 00:00:00 2001 From: cclauss Date: Thu, 23 Nov 2017 06:53:20 +0100 Subject: [PATCH] except ParseError: --> except ParseError as e: Signed-off-by: cclauss --- cli/sawtooth_cli/identity.py | 2 +- cli/sawtooth_cli/sawset.py | 2 +- consensus/poet/cli/sawtooth_poet_cli/registration.py | 2 +- validator/sawtooth_validator/server/keys.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/sawtooth_cli/identity.py b/cli/sawtooth_cli/identity.py index 10034f4b89..af46e1da29 100644 --- a/cli/sawtooth_cli/identity.py +++ b/cli/sawtooth_cli/identity.py @@ -560,7 +560,7 @@ def _read_signer(key_filename): try: private_key = Secp256k1PrivateKey.from_hex(signing_key) - except ParseError: + except ParseError as e: try: private_key = Secp256k1PrivateKey.from_wif(signing_key) except ParseError: diff --git a/cli/sawtooth_cli/sawset.py b/cli/sawtooth_cli/sawset.py index 13fdcb0ad8..0207576bd8 100644 --- a/cli/sawtooth_cli/sawset.py +++ b/cli/sawtooth_cli/sawset.py @@ -286,7 +286,7 @@ def _read_signer(key_filename): except ParseError: try: private_key = Secp256k1PrivateKey.from_wif(signing_key) - except ParseError: + except ParseError as e: raise CliException('Unable to read key in file: {}'.format(str(e))) context = create_context('secp256k1') diff --git a/consensus/poet/cli/sawtooth_poet_cli/registration.py b/consensus/poet/cli/sawtooth_poet_cli/registration.py index 2462ccbf8f..40eb144297 100644 --- a/consensus/poet/cli/sawtooth_poet_cli/registration.py +++ b/consensus/poet/cli/sawtooth_poet_cli/registration.py @@ -254,7 +254,7 @@ def _read_signer(key_filename): except ParseError: try: private_key = Secp256k1PrivateKey.from_wif(signing_key) - except ParseError: + except ParseError as e: raise CliException('Unable to read key in file: {}'.format(str(e))) context = create_context('secp256k1') diff --git a/validator/sawtooth_validator/server/keys.py b/validator/sawtooth_validator/server/keys.py index 26e5a4434a..aaf5ba1cbf 100644 --- a/validator/sawtooth_validator/server/keys.py +++ b/validator/sawtooth_validator/server/keys.py @@ -57,7 +57,7 @@ def load_identity_signer(key_dir, key_name): except signing.ParseError: try: private_key = Secp256k1PrivateKey.from_wif(private_key_str) - except signing.ParseError: + except signing.ParseError as e: raise LocalConfigurationError( "Invalid key in file {}: {}".format(key_path, str(e)))