mirror of
https://github.com/python/cpython.git
synced 2026-01-05 23:12:38 +00:00
[3.14] gh-142737: Handle lost io.open in _Py_FindSourceFile (GH-142747) (GH-142773)
gh-142737: Handle lost `io.open` in `_Py_FindSourceFile` (GH-142747)
(cherry picked from commit f277781bba)
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
This commit is contained in:
parent
88ac9956cd
commit
b9cbdde80d
4 changed files with 35 additions and 1 deletions
|
|
@ -416,6 +416,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