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
06f6fbff
Commit
06f6fbff
authored
Jul 22, 2013
by
Brian Curtin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #18530. Remove extra stat call from posixpath.ismount
parent
7b3902a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
Lib/posixpath.py
Lib/posixpath.py
+14
-8
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/posixpath.py
View file @
06f6fbff
...
...
@@ -182,18 +182,24 @@ def lexists(path):
def
ismount
(
path
):
"""Test whether a path is a mount point"""
if
islink
(
path
):
# A symlink can never be a mount point
return
False
try
:
s1
=
os
.
lstat
(
path
)
if
isinstance
(
path
,
bytes
):
parent
=
join
(
path
,
b'..'
)
else
:
parent
=
join
(
path
,
'..'
)
except
OSError
:
# It doesn't exist -- so not a mount point. :-)
return
False
else
:
if
stat
.
S_ISLNK
(
s1
.
st_mode
):
return
False
if
isinstance
(
path
,
bytes
):
parent
=
join
(
path
,
b'..'
)
else
:
parent
=
join
(
path
,
'..'
)
try
:
s2
=
os
.
lstat
(
parent
)
except
OSError
:
return
False
# It doesn't exist -- so not a mount point :-)
return
False
dev1
=
s1
.
st_dev
dev2
=
s2
.
st_dev
if
dev1
!=
dev2
:
...
...
Misc/NEWS
View file @
06f6fbff
...
...
@@ -162,6 +162,9 @@ Core and Builtins
Library
-------
-
Issue
#
18530
:
Remove
additional
stat
call
from
posixpath
.
ismount
.
Patch
by
Alex
Gaynor
.
-
Issue
#
18514
:
Fix
unreachable
Py_DECREF
()
call
in
PyCData_FromBaseObj
()
-
Issue
#
9177
:
Calling
read
()
or
write
()
now
raises
ValueError
,
not
...
...
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