]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Clear errno before calling opendir() and readdir().
authorGeorg Brandl <georg@python.org>
Tue, 11 Apr 2006 07:04:09 +0000 (07:04 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 11 Apr 2006 07:04:09 +0000 (07:04 +0000)
 (backport from rev. 45262)

Modules/posixmodule.c

index 1a514692a0d76491c3f90562501ee988524e9fbe..089b40a964231383ed34817045b547cfffe685d8 100644 (file)
@@ -1648,6 +1648,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();