MCPcopy Index your code
hub / github.com/python/cpython / find_gil_minsize

Function find_gil_minsize

Lib/test/support/hashlib_helper.py:831–845  ·  view source on GitHub ↗

Get the largest GIL_MINSIZE value for the given cryptographic modules. The valid module names are the following: - _hashlib - _md5, _sha1, _sha2, _sha3, _blake2 - _hmac

(modules_names, default=2048)

Source from the content-addressed store, hash-verified

829
830
831def find_gil_minsize(modules_names, default=2048):
832 """Get the largest GIL_MINSIZE value for the given cryptographic modules.
833
834 The valid module names are the following:
835
836 - _hashlib
837 - _md5, _sha1, _sha2, _sha3, _blake2
838 - _hmac
839 """
840 sizes = []
841 for module_name in modules_names:
842 module = _import_module(module_name)
843 if module is not None:
844 sizes.append(getattr(module, '_GIL_MINSIZE', default))
845 return max(sizes, default=default)
846
847
848def _block_openssl_hash_new(blocked_name):

Callers

nothing calls this directly

Calls 2

_import_moduleFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…