From 210472e0aedf756841eb440e6f9a06838a9e6db7 Mon Sep 17 00:00:00 2001 From: zhangbl Date: Tue, 29 Aug 2023 19:53:12 +0800 Subject: [PATCH] feat: update test_hashlib fro CPython3.11 --- Lib/hashlib.py | 4 ++-- Lib/test/test_hashlib.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) 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 )