From 05e89b86d66cbd90b9c43ebe89f42dfcc6f558fe Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 11 Apr 2006 07:04:06 +0000 Subject: Clear errno before calling opendir() and readdir(). --- Modules/posixmodule.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 39765b2..a0a8d9a 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1845,6 +1845,7 @@ posix_listdir(PyObject *self, PyObject *args) struct dirent *ep; int arg_is_unicode = 1; + errno = 0; if (!PyArg_ParseTuple(args, "U:listdir", &v)) { arg_is_unicode = 0; PyErr_Clear(); -- cgit v0.12