Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c1bdbc3

Browse files
committed
Cosmetic changes to Christian's patch r58903.
(Consider this code review feedback. :-)
1 parent 7d3bc0a commit c1bdbc3

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

Python/import.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2939,12 +2939,12 @@ NullImporter_init(NullImporter *self, PyObject *args, PyObject *kwds)
29392939
struct stat statbuf;
29402940
int rv;
29412941

2942+
rv = stat(path, &statbuf);
29422943
#ifdef MS_WINDOWS
2943-
/* MS Windows' stat chokes on paths like C:\\path\\. Try to
2944-
* recover *one* time by stripping of a trailing slash or
2945-
* back slash. http://bugs.python.org/issue1293
2944+
/* MS Windows stat() chokes on paths like C:\path\. Try to
2945+
* recover *one* time by stripping off a trailing slash or
2946+
* backslash. http://bugs.python.org/issue1293
29462947
*/
2947-
rv = stat(path, &statbuf);
29482948
if (rv != 0 && pathlen <= MAXPATHLEN &&
29492949
(path[pathlen-1] == '/' || path[pathlen-1] == '\\')) {
29502950
char mangled[MAXPATHLEN+1];
@@ -2953,8 +2953,6 @@ NullImporter_init(NullImporter *self, PyObject *args, PyObject *kwds)
29532953
mangled[pathlen-1] = '\0';
29542954
rv = stat(mangled, &statbuf);
29552955
}
2956-
#else
2957-
rv = stat(path, &statbuf);
29582956
#endif
29592957
if (rv == 0) {
29602958
/* it exists */

0 commit comments

Comments
 (0)