]> granicus.if.org Git - python/commitdiff
Clear errno before calling opendir() and readdir().
authorGeorg Brandl <georg@python.org>
Tue, 11 Apr 2006 07:04:06 +0000 (07:04 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 11 Apr 2006 07:04:06 +0000 (07:04 +0000)
Modules/posixmodule.c

index 39765b2b91e7e2469f01366802b396b7529f0bf4..a0a8d9a8e68574d5a0eab42a2b7741eabfc5c6ef 100644 (file)
@@ -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();