diff Python/import.c @ 43790:dba2491cf717

Cosmetic changes to Christian's patch r58903. (Consider this code review feedback. :-)
author Guido van Rossum <guido@python.org>
date Wed, 07 Nov 2007 17:46:34 +0000
parents 1247d24b287b
children 41f7c13ef161
line wrap: on
line diff
--- a/Python/import.c	Wed Nov 07 17:26:16 2007 +0000
+++ b/Python/import.c	Wed Nov 07 17:46:34 2007 +0000
@@ -2939,12 +2939,12 @@
 		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 @@
 			mangled[pathlen-1] = '\0';
 			rv = stat(mangled, &statbuf);
 		}
-#else
-		rv = stat(path, &statbuf);
 #endif
 		if (rv == 0) {
 			/* it exists */