diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-20 15:16:55 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-20 15:16:55 +0200 |
commit | fab579dcbba91dc35f5f2b25fcf221736fff5e4b (patch) | |
tree | 575870b234ea741159f2b6c5c0eae4928ca5ad8d /Python/import.c | |
parent | 1a17e5818c9c58989ffdd4d0e2931db9c66579a0 (diff) | |
download | cpython-fab579dcbba91dc35f5f2b25fcf221736fff5e4b.tar.gz |
call_find_module() handles dup() failure: raise an OSError exception
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c index de5dc0ca41..19e975a593 100644 --- a/Python/import.c +++ b/Python/import.c @@ -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) { |