mirror of
https://github.com/python/cpython.git
synced 2025-08-17 07:11:51 +00:00
Fix indentation
This commit is contained in:
parent
fa93cf8e3e
commit
0737b7281e
1 changed files with 16 additions and 16 deletions
|
@ -116,28 +116,28 @@ static const struct filedescr _PyImport_StandardFiletab[] = {
|
||||||
|
|
||||||
#ifdef MS_WINDOWS
|
#ifdef MS_WINDOWS
|
||||||
int isdir(char *path) {
|
int isdir(char *path) {
|
||||||
DWORD rv;
|
DWORD rv;
|
||||||
/* see issue1293 and issue3677:
|
/* see issue1293 and issue3677:
|
||||||
* stat() on Windows doesn't recognise paths like
|
* stat() on Windows doesn't recognise paths like
|
||||||
* "e:\\shared\\" and "\\\\whiterab-c2znlh\\shared" as dirs.
|
* "e:\\shared\\" and "\\\\whiterab-c2znlh\\shared" as dirs.
|
||||||
* Also reference issue6727:
|
* Also reference issue6727:
|
||||||
* stat() on Windows is broken and doesn't resolve symlinks properly.
|
* stat() on Windows is broken and doesn't resolve symlinks properly.
|
||||||
*/
|
*/
|
||||||
rv = GetFileAttributesA(path);
|
rv = GetFileAttributesA(path);
|
||||||
return rv != INVALID_FILE_ATTRIBUTES && rv & FILE_ATTRIBUTE_DIRECTORY;
|
return rv != INVALID_FILE_ATTRIBUTES && rv & FILE_ATTRIBUTE_DIRECTORY;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#if HAVE_STAT
|
#if HAVE_STAT
|
||||||
int isdir(char *path) {
|
int isdir(char *path) {
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
return stat(path, &statbuf) == 0 && S_ISDIR(statbuf.st_mode);
|
return stat(path, &statbuf) == 0 && S_ISDIR(statbuf.st_mode);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#ifdef RISCOS
|
#ifdef RISCOS
|
||||||
/* with RISCOS, isdir is in unixstuff */
|
/* with RISCOS, isdir is in unixstuff */
|
||||||
#else
|
#else
|
||||||
int isdir(char *path) {
|
int isdir(char *path) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* RISCOS */
|
#endif /* RISCOS */
|
||||||
#endif /* HAVE_STAT */
|
#endif /* HAVE_STAT */
|
||||||
|
@ -3200,11 +3200,11 @@ NullImporter_init(NullImporter *self, PyObject *args, PyObject *kwds)
|
||||||
PyErr_SetString(PyExc_ImportError, "empty pathname");
|
PyErr_SetString(PyExc_ImportError, "empty pathname");
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
if(isdir(path)) {
|
if(isdir(path)) {
|
||||||
PyErr_SetString(PyExc_ImportError,
|
PyErr_SetString(PyExc_ImportError,
|
||||||
"existing directory");
|
"existing directory");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue