mirror of
https://github.com/python/cpython.git
synced 2026-10-29 02:45:15 +08:00
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:
1 parent
89e2a5e0cb
commit
91abe31b2c
3 files changed
+998
-67
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user