Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0737b728
Commit
0737b728
authored
Jan 13, 2012
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix indentation
parent
fa93cf8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
Python/import.c
Python/import.c
+16
-16
No files found.
Python/import.c
View file @
0737b728
...
@@ -116,28 +116,28 @@ static const struct filedescr _PyImport_StandardFiletab[] = {
...
@@ -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)
...
@@ -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
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment