[Python-checkins] cpython: Issue #13739: It's simpler and more direct to call rewinddir() at the

charles-francois.natali python-checkins at python.org
Sun Jan 8 19:07:41 CET 2012


http://hg.python.org/cpython/rev/36f2e236c601
changeset:   74303:36f2e236c601
user:        Charles-François Natali <neologix at free.fr>
date:        Sun Jan 08 19:07:18 2012 +0100
summary:
  Issue #13739: It's simpler and more direct to call rewinddir() at the
beginning.

files:
  Modules/posixmodule.c |  3 +--
  1 files changed, 1 insertions(+), 2 deletions(-)


diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -2890,6 +2890,7 @@
         close(fd);
         return posix_error();
     }
+    rewinddir(dirp);
     if ((d = PyList_New(0)) == NULL) {
         Py_BEGIN_ALLOW_THREADS
         closedir(dirp);
@@ -2906,7 +2907,6 @@
                 break;
             } else {
                 Py_BEGIN_ALLOW_THREADS
-                rewinddir(dirp);
                 closedir(dirp);
                 Py_END_ALLOW_THREADS
                 Py_DECREF(d);
@@ -2930,7 +2930,6 @@
         Py_DECREF(v);
     }
     Py_BEGIN_ALLOW_THREADS
-    rewinddir(dirp);
     closedir(dirp);
     Py_END_ALLOW_THREADS
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list