summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1999-05-27 23:13:21 (GMT)
committerBarry Warsaw <barry@python.org>1999-05-27 23:13:21 (GMT)
commitf63b8cc07c1782b4319c314b0ff0245f5ec5f455 (patch)
tree785a091c349346b6fec034f7daef6d62d224a049 /Modules
parentf1882422d2531ff45a35f7c1b9429e1d86a8b417 (diff)
downloadcpython-f63b8cc07c1782b4319c314b0ff0245f5ec5f455.zip
cpython-f63b8cc07c1782b4319c314b0ff0245f5ec5f455.tar.gz
cpython-f63b8cc07c1782b4319c314b0ff0245f5ec5f455.tar.bz2
posix_listdir(): When an error occurs, call
posix_error_with_filename() instead of posix_error(), passing in the name argument, so you get information on which directory was being listed.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index f3fbd7a..f7b16a0 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -773,7 +773,7 @@ posix_listdir(self, args)
errno = GetLastError();
if (errno == ERROR_FILE_NOT_FOUND)
return PyList_New(0);
- return posix_error();
+ return posix_error_with_filename(name);
}
do {
if (FileData.cFileName[0] == '.' &&
@@ -798,7 +798,7 @@ posix_listdir(self, args)
if (FindClose(hFindFile) == FALSE) {
errno = GetLastError();
- return posix_error();
+ return posix_error_with_filename(&name);
}
return d;
@@ -836,7 +836,7 @@ posix_listdir(self, args)
_A_HIDDEN | _A_SYSTEM | _A_SUBDIR, &ep) != 0)
{
errno = ENOENT;
- return posix_error();
+ return posix_error_with_filename(name);
}
do {
if (ep.name[0] == '.' &&
@@ -906,7 +906,7 @@ posix_listdir(self, args)
if (rc != NO_ERROR) {
errno = ENOENT;
- return posix_error();
+ return posix_error_with_filename(name);
}
if (srchcnt > 0) { /* If Directory is NOT Totally Empty, */
@@ -948,7 +948,7 @@ posix_listdir(self, args)
Py_BEGIN_ALLOW_THREADS
if ((dirp = opendir(name)) == NULL) {
Py_BLOCK_THREADS
- return posix_error();
+ return posix_error_with_filename(name);
}
if ((d = PyList_New(0)) == NULL) {
closedir(dirp);