mirror of
https://github.com/python/cpython.git
synced 2024-11-26 03:14:27 +08:00
call_find_module() handles dup() failure: raise an OSError exception
This commit is contained in:
parent
925ef39949
commit
d417d01ec8
@ -3567,6 +3567,10 @@ call_find_module(PyObject *name, PyObject *path_list)
|
||||
if (fd != -1)
|
||||
fd = dup(fd);
|
||||
fclose(fp);
|
||||
if (fd == -1) {
|
||||
PyErr_SetFromErrno(PyExc_OSError);
|
||||
return NULL;
|
||||
}
|
||||
fp = NULL;
|
||||
}
|
||||
if (fd != -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user