]> granicus.if.org Git - python/commitdiff
Cosmetic changes to Christian's patch r58903.
authorGuido van Rossum <guido@python.org>
Wed, 7 Nov 2007 17:46:34 +0000 (17:46 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 7 Nov 2007 17:46:34 +0000 (17:46 +0000)
(Consider this code review feedback. :-)

Python/import.c

index d2922e98d99d1be2c74593f78590185aca93229d..b97b3eb8402add098325b5b925b691abec759006 100644 (file)
@@ -2939,12 +2939,12 @@ NullImporter_init(NullImporter *self, PyObject *args, PyObject *kwds)
                struct stat statbuf;
                int rv;
 
+               rv = stat(path, &statbuf);
 #ifdef MS_WINDOWS
-               /* MS Windows' stat chokes on paths like C:\\path\\. Try to
-                * recover *one* time by stripping of a trailing slash or
-                * back slash. http://bugs.python.org/issue1293
+               /* MS Windows stat() chokes on paths like C:\path\. Try to
+                * recover *one* time by stripping off a trailing slash or
+                * backslash. http://bugs.python.org/issue1293
                 */
-               rv = stat(path, &statbuf);
                if (rv != 0 && pathlen <= MAXPATHLEN &&
                    (path[pathlen-1] == '/' || path[pathlen-1] == '\\')) {
                        char mangled[MAXPATHLEN+1];
@@ -2953,8 +2953,6 @@ NullImporter_init(NullImporter *self, PyObject *args, PyObject *kwds)
                        mangled[pathlen-1] = '\0';
                        rv = stat(mangled, &statbuf);
                }
-#else
-               rv = stat(path, &statbuf);
 #endif
                if (rv == 0) {
                        /* it exists */