Kaydet (Commit) f326665f authored tarafından Victor Stinner's avatar Victor Stinner

Fix os.listdir(): _Py_dup() already raises an exception on error, no need to

raise a new exception
üst feae73e1
......@@ -3746,10 +3746,8 @@ _posix_listdir(path_t *path, PyObject *list)
if (path->fd != -1) {
/* closedir() closes the FD, so we duplicate it */
fd = _Py_dup(path->fd);
if (fd == -1) {
list = posix_error();
goto exit;
}
if (fd == -1)
return NULL;
return_str = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment