mirror of
https://github.com/python/cpython.git
synced 2026-01-08 08:22:41 +00:00
gh-142737: Handle lost io.open in _Py_FindSourceFile (GH-142747)
This commit is contained in:
parent
790a46a449
commit
f277781bba
4 changed files with 35 additions and 1 deletions
|
|
@ -415,6 +415,9 @@ _Py_FindSourceFile(PyObject *filename, char* namebuf, size_t namelen, PyObject *
|
|||
npath = PyList_Size(syspath);
|
||||
|
||||
open = PyObject_GetAttr(io, &_Py_ID(open));
|
||||
if (open == NULL) {
|
||||
goto error;
|
||||
}
|
||||
for (i = 0; i < npath; i++) {
|
||||
v = PyList_GetItem(syspath, i);
|
||||
if (v == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue