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: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=05e89b86d66cbd90b9c43ebe89f42dfcc6f558fe;p=thirdparty%2FPython%2Fcpython.git Clear errno before calling opendir() and readdir(). --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 39765b2b91e7..a0a8d9a8e685 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();