/
githubmirror
/
cpython
Обзор
Документация
Войти
/
githubmirror
/
cpython
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
Modules/_testlimitedcapi/run.c
34 строки
618 B
Victor Stinner
gh-152132: Test Py_CompileString() in test_capi.test_run (#153470)
10 июл 2026, 04:36
Не верифицирован
10 июл 2026, 04:36
d83d267
Код
Авторство
О чём код?
#include "parts.h" #include "util.h" // Test functions, not macros #undef Py_CompileString // Test Py_CompileString() static PyObject* run_compilestring(PyObject *mod, PyObject *args) { const char *str; const char *filename; int start; if (!PyArg_ParseTuple(args, "yyi", &str, &filename, &start)) { return NULL; } return Py_CompileString(str, filename, start); } static PyMethodDef test_methods[] = { {"run_compilestring", run_compilestring, METH_VARARGS}, {NULL}, }; int _PyTestLimitedCAPI_Init_Run(PyObject *m) { return PyModule_AddFunctions(m, test_methods); }