diff options
author | stratakis <cstratak@redhat.com> | 2020-06-17 17:26:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-17 17:26:08 (GMT) |
commit | 236a0f5cf022b59dbb6ea17a8e7a677c573d39b9 (patch) | |
tree | 083a43ca43d9e464eeb61e470cd15b93998a9678 /Lib/test/test_hashlib.py | |
parent | 98ce7b107e6611d04dc35a4f5b02ea215ef122cf (diff) | |
download | cpython-236a0f5cf022b59dbb6ea17a8e7a677c573d39b9.zip cpython-236a0f5cf022b59dbb6ea17a8e7a677c573d39b9.tar.gz cpython-236a0f5cf022b59dbb6ea17a8e7a677c573d39b9.tar.bz2 |
bpo-40637: Do not emit warnings for disabled builtin hashes (GH-20937)
test_hashlib emits some warnings when it cannot find some hashes
as it assumes they failed to compile. Since we can disable hashes
through configure, we emit the warnings only in the case that we
did not intentionaly disable them.
Automerge-Triggered-By: @tiran
Diffstat (limited to 'Lib/test/test_hashlib.py')
-rw-r--r-- | Lib/test/test_hashlib.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index 2f79244..ba90298 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -103,7 +103,7 @@ class HashLibTestCase(unittest.TestCase): try: return importlib.import_module(module_name) except ModuleNotFoundError as error: - if self._warn_on_extension_import: + if self._warn_on_extension_import and module_name in builtin_hashes: warnings.warn('Did a C extension fail to compile? %s' % error) return None |