diff options
author | Sebastian Ramacher <s.ramacher@gmx.at> | 2012-05-28 13:32:13 +0200 |
---|---|---|
committer | Sebastian Ramacher <s.ramacher@gmx.at> | 2012-05-28 13:32:13 +0200 |
commit | 8c0572a871e61f9692134bc6bea02ec9778089c9 (patch) | |
tree | 3d1f88b8c64a23f1b873b087349a3a74fcf5f7ef | |
parent | cbc13b3f4203ceec940cf90e32962a85650226fd (diff) | |
download | pycrypto-8c0572a871e61f9692134bc6bea02ec9778089c9.tar.gz |
Except shadows builtin IndexError.
Constructs like
try:
...
except ValueError, IndexError:
...
don't work as expected. This only catches a ValueError and replaces the builtin
IndexError with the catches ValueError object. See [1] for details.
[1] http://docs.python.org/whatsnew/2.6.html#pep-3110-exception-handling-changes
-rw-r--r-- | lib/Crypto/PublicKey/RSA.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Crypto/PublicKey/RSA.py b/lib/Crypto/PublicKey/RSA.py index 99d851d..27c23be 100644 --- a/lib/Crypto/PublicKey/RSA.py +++ b/lib/Crypto/PublicKey/RSA.py @@ -582,7 +582,7 @@ class RSAImplementation(object): if privateKey.isType('OCTET STRING'): return self._importKeyDER(privateKey.payload) - except ValueError, IndexError: + except (ValueError, IndexError): pass raise ValueError("RSA key format is not supported") |