From 9417eec81e6d1656c35e33fdcf841e731ef5edc8 Mon Sep 17 00:00:00 2001 From: Reid00 <38450639+Reid00@users.noreply.github.com> Date: Tue, 29 Aug 2023 23:09:21 +0800 Subject: [PATCH] feat: update test_hashlib fro CPython3.11 (#5053) Co-authored-by: zhangbl --- 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 52a4f8a77..e5f81d754 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 6f12aaa93..c03208427 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -400,9 +400,6 @@ class HashLibTestCase(unittest.TestCase): 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 )