bpo-37146: Deactivate opcode cache only when using huntrleaks in the test suite (GH-24643)

This commit is contained in:
Pablo Galindo 2021-02-28 22:41:09 +00:00 committed by GitHub
parent e8f5ddd33e
commit af5fa13ef6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 11 deletions

View file

@ -1958,6 +1958,20 @@ sys_getandroidapilevel_impl(PyObject *module)
#endif /* ANDROID_API_LEVEL */
/*[clinic input]
sys._deactivate_opcache
Deactivate the opcode cache permanently
[clinic start generated code]*/
static PyObject *
sys__deactivate_opcache_impl(PyObject *module)
/*[clinic end generated code: output=00e20982bd012122 input=501eac146735ccf9]*/
{
_PyEval_DeactivateOpCache();
Py_RETURN_NONE;
}
static PyMethodDef sys_methods[] = {
/* Might as well keep this in alphabetic order */
@ -2011,6 +2025,7 @@ static PyMethodDef sys_methods[] = {
SYS_GET_ASYNCGEN_HOOKS_METHODDEF
SYS_GETANDROIDAPILEVEL_METHODDEF
SYS_UNRAISABLEHOOK_METHODDEF
SYS__DEACTIVATE_OPCACHE_METHODDEF
{NULL, NULL} /* sentinel */
};