diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2014-01-03 13:05:06 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2014-01-03 13:05:06 (GMT) |
commit | 24e43308b7e40c09717c1ab99014710fa5a01735 (patch) | |
tree | b2a1198fbbb3e38ff6232785d474d6a0354a2648 /Lib/hashlib.py | |
parent | f3b46b4a66560945d4c80ac2f10764e3d7f71f8d (diff) | |
download | cpython-24e43308b7e40c09717c1ab99014710fa5a01735.zip cpython-24e43308b7e40c09717c1ab99014710fa5a01735.tar.gz cpython-24e43308b7e40c09717c1ab99014710fa5a01735.tar.bz2 |
* Issue #16113: Remove sha3 module again.
Patch by Christian Heimes, with modifications.
Diffstat (limited to 'Lib/hashlib.py')
-rw-r--r-- | Lib/hashlib.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/Lib/hashlib.py b/Lib/hashlib.py index 77673f0..e652fc6 100644 --- a/Lib/hashlib.py +++ b/Lib/hashlib.py @@ -54,8 +54,7 @@ More condensed: # This tuple and __get_builtin_constructor() must be modified if a new # always available algorithm is added. -__always_supported = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', - 'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512') +__always_supported = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512') algorithms_guaranteed = set(__always_supported) algorithms_available = set(__always_supported) @@ -86,13 +85,6 @@ def __get_builtin_constructor(name): import _sha512 cache['SHA384'] = cache['sha384'] = _sha512.sha384 cache['SHA512'] = cache['sha512'] = _sha512.sha512 - elif name in {'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512', - 'SHA3_224', 'SHA3_256', 'SHA3_384', 'SHA3_512'}: - import _sha3 - cache['SHA3_224'] = cache['sha3_224'] = _sha3.sha3_224 - cache['SHA3_256'] = cache['sha3_256'] = _sha3.sha3_256 - cache['SHA3_384'] = cache['sha3_384'] = _sha3.sha3_384 - cache['SHA3_512'] = cache['sha3_512'] = _sha3.sha3_512 except ImportError: pass # no extension module, this hash is unsupported. |