[3.13] gh-152132: Test all PyRun functions in test_capi.test_run (#153352) (#153414)

gh-152132: Test all PyRun functions in test_capi.test_run (#153352)

PyRun_InteractiveOneObjectEx() now raises TypeError if the second
parameter type is not str.

(cherry picked from commit cd9994e283)
This commit is contained in:
Victor Stinner authored and GitHub committed 2026-07-09 13:57:21 +00:00
1 parent 89e2a5e0cb
commit 91abe31b2c
3 files changed
+998 -67

No files matched your search

+6
View File
@@ -286,6 +286,12 @@ static int
PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename,
PyCompilerFlags *flags)
{
if (!PyUnicode_Check(filename)) {
PyErr_Format(PyExc_TypeError, "expect str for filename, got %T",
filename);
return -1;
}
PyArena *arena = _PyArena_New();
if (arena == NULL) {
return -1;