diff options
-rw-r--r-- | Modules/posixmodule.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 6708df8..8174890 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -644,6 +644,8 @@ posix_listdir(self, args) hFindFile = FindFirstFile(namebuf, &FileData); if (hFindFile == INVALID_HANDLE_VALUE) { errno = GetLastError(); + if (errno == ERROR_FILE_NOT_FOUND) + return PyList_New(0); return posix_error(); } do { |