diff --git a/Lib/hashlib.py b/Lib/hashlib.py index 52a4f8a77b..e5f81d754a 100644 --- a/Lib/hashlib.py +++ b/Lib/hashlib.py @@ -114,8 +114,8 @@ def __get_builtin_constructor(name): cache['shake_128'] = _sha3.shake_128 cache['shake_256'] = _sha3.shake_256 except ImportError: - pass # no extension module, this hash is unsupported.''' - + pass # no extension module, this hash is unsupported. + constructor = cache.get(name) if constructor is not None: return constructor diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index 6f12aaa936..c03208427a 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -400,9 +400,6 @@ def check_file_digest(self, name, data, hexdigest): for digest in digests: buf = io.BytesIO(data) buf.seek(0) - '''self.assertEqual( - dir(hashlib), None - )''' self.assertEqual( hashlib.file_digest(buf, digest).hexdigest(), hexdigest )