diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-04-17 20:45:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-17 20:45:35 (GMT) |
commit | 6078f2033ea15a16cf52fe8d644a95a3be72d2e3 (patch) | |
tree | fc6b42b0b086bfc2d2e596d7e9c4fcbadf609fd9 /Modules/_testcapimodule.c | |
parent | c1d7147c820545bb0a97a072fdba82154fd97ab6 (diff) | |
download | cpython-6078f2033ea15a16cf52fe8d644a95a3be72d2e3.zip cpython-6078f2033ea15a16cf52fe8d644a95a3be72d2e3.tar.gz cpython-6078f2033ea15a16cf52fe8d644a95a3be72d2e3.tar.bz2 |
gh-117968: Add tests for the part of the PyRun family of the C API (GH-117982)
Co-authored-by: NGRsoftlab <78017794+NGRsoftlab@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r-- | Modules/_testcapimodule.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index eff61dd..034a30fa 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -3904,6 +3904,16 @@ PyInit__testcapi(void) PyModule_AddIntConstant(m, "the_number_three", 3); PyModule_AddIntMacro(m, Py_C_RECURSION_LIMIT); + if (PyModule_AddIntMacro(m, Py_single_input)) { + return NULL; + } + if (PyModule_AddIntMacro(m, Py_file_input)) { + return NULL; + } + if (PyModule_AddIntMacro(m, Py_eval_input)) { + return NULL; + } + testcapistate_t *state = get_testcapi_state(m); state->error = PyErr_NewException("_testcapi.error", NULL, NULL); PyModule_AddObject(m, "error", state->error); @@ -3998,6 +4008,9 @@ PyInit__testcapi(void) if (_PyTestCapi_Init_PyAtomic(m) < 0) { return NULL; } + if (_PyTestCapi_Init_Run(m) < 0) { + return NULL; + } if (_PyTestCapi_Init_Hash(m) < 0) { return NULL; } |