提交 e5b19522 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Make sure the hash of a cmodule never changes.

上级 856aa0b6
......@@ -253,7 +253,10 @@ static struct PyModuleDef moduledef = {{
self.print_init(sio)
rval = sio.getvalue()
self.code_hash = hash_from_code(rval)
# Make sure the hash of the code hasn't changed
h = hash_from_code(rval)
assert self.code_hash is None or self.code_hash == h
self.code_hash = h
rval = re.sub(self.hash_placeholder, self.code_hash, rval)
# Finalize the Module, so no support code or function
# can be added
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论