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

Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Reduce syscalls for posixpath.ismount
  • Loading branch information
nineteendo committed Mar 30, 2024
commit d623b82c459265f1ccb6cd9d0df079ab206feadc
7 changes: 1 addition & 6 deletions Lib/posixpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,7 @@ def ismount(path):
if stat.S_ISLNK(s1.st_mode):
return False

path = os.fspath(path)
if isinstance(path, bytes):
parent = join(path, b'..')
else:
parent = join(path, '..')
parent = realpath(parent)
parent = dirname(abspath(path))
try:
s2 = os.lstat(parent)
except (OSError, ValueError):
Expand Down