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

Function _make_hash_constructor_blocker

Lib/test/support/hashlib_helper.py:970–977  ·  view source on GitHub ↗
(name, dummy, implementation)

Source from the content-addressed store, hash-verified

968
969
970def _make_hash_constructor_blocker(name, dummy, implementation):
971 info = get_hash_func_info(name)[implementation]
972 if (wrapped := info.import_member()) is None:
973 # function shouldn't exist for this implementation
974 return contextlib.nullcontext()
975 wrapper = functools.wraps(wrapped)(dummy)
976 _ensure_wrapper_signature(wrapper, wrapped)
977 return unittest.mock.patch(info.fullname, wrapper)
978
979
980def _block_hashlib_hash_constructor(name):

Calls 3

get_hash_func_infoFunction · 0.85
import_memberMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…