From af5fa13ef6f648fc7a7a33a7556db13887e7d643 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Sun, 28 Feb 2021 22:41:09 +0000 Subject: bpo-37146: Deactivate opcode cache only when using huntrleaks in the test suite (GH-24643) --- Python/sysmodule.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Python/sysmodule.c') diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 13b9034bf7..686b6cae3b 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -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 */ }; -- cgit v1.2.1