Skip to content

Commit

Permalink
bpo-40637: Do not emit warnings for disabled builtin hashes (pythonGH…
Browse files Browse the repository at this point in the history
…-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
  • Loading branch information
stratakis committed Jun 17, 2020
1 parent 98ce7b1 commit 236a0f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/test_hashlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _conditional_import_module(self, module_name):
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

Expand Down

0 comments on commit 236a0f5

Please sign in to comment.