diff options
author | Christian Heimes <christian@cheimes.de> | 2007-11-07 18:30:22 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-11-07 18:30:22 (GMT) |
commit | 004c1c15621eff6bda20c66ce4e5d5c49c90ff25 (patch) | |
tree | f85d97338edc23732879346cd03333ce3759ddf6 | |
parent | cea681be192d9aa9cc33f15f78f3645424a0974f (diff) | |
download | cpython-004c1c15621eff6bda20c66ce4e5d5c49c90ff25.zip cpython-004c1c15621eff6bda20c66ce4e5d5c49c90ff25.tar.gz cpython-004c1c15621eff6bda20c66ce4e5d5c49c90ff25.tar.bz2 |
Backport of Guido's review of my patch.
-rw-r--r-- | Python/import.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Python/import.c b/Python/import.c index 265afb9..6a4d22f 100644 --- a/Python/import.c +++ b/Python/import.c @@ -2996,12 +2996,12 @@ NullImporter_init(NullImporter *self, PyObject *args, PyObject *kwds) struct stat statbuf; int rv; -#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 - */ rv = stat(path, &statbuf); +#ifdef MS_WINDOWS + /* 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 + */ if (rv != 0 && pathlen <= MAXPATHLEN && (path[pathlen-1] == '/' || path[pathlen-1] == '\\')) { char mangled[MAXPATHLEN+1]; @@ -3010,8 +3010,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 */ |