From: Georg Brandl Date: Tue, 11 Apr 2006 07:04:06 +0000 (+0000) Subject: Clear errno before calling opendir() and readdir(). X-Git-Tag: v2.5a2~345 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=05e89b86d66cbd90b9c43ebe89f42dfcc6f558fe;p=python Clear errno before calling opendir() and readdir(). --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 39765b2b91..a0a8d9a8e6 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();