mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
Fix os.listdir(): _Py_dup() already raises an exception on error, no need to
raise a new exception
This commit is contained in:
parent
feae73e13f
commit
f326665fe7
1 changed files with 2 additions and 4 deletions
|
|
@ -3746,10 +3746,8 @@ _posix_listdir(path_t *path, PyObject *list)
|
||||||
if (path->fd != -1) {
|
if (path->fd != -1) {
|
||||||
/* closedir() closes the FD, so we duplicate it */
|
/* closedir() closes the FD, so we duplicate it */
|
||||||
fd = _Py_dup(path->fd);
|
fd = _Py_dup(path->fd);
|
||||||
if (fd == -1) {
|
if (fd == -1)
|
||||||
list = posix_error();
|
return NULL;
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
return_str = 1;
|
return_str = 1;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue