mirror of
https://github.com/arsenetar/send2trash.git
synced 2025-05-08 09:49:52 +00:00
Use realpath to find mountpoint
This commit is contained in:
parent
358b705cbc
commit
d090156c45
@ -81,7 +81,8 @@ def trash_move(src, dst, topdir=None):
|
|||||||
|
|
||||||
def find_mount_point(path):
|
def find_mount_point(path):
|
||||||
# Even if something's wrong, "/" is a mount point, so the loop will exit.
|
# Even if something's wrong, "/" is a mount point, so the loop will exit.
|
||||||
path = op.abspath(path) # Required to avoid infinite loop
|
# Use realpath in case it's a symlink
|
||||||
|
path = op.realpath(path) # Required to avoid infinite loop
|
||||||
while not op.ismount(path):
|
while not op.ismount(path):
|
||||||
path = op.split(path)[0]
|
path = op.split(path)[0]
|
||||||
return path
|
return path
|
||||||
|
Loading…
x
Reference in New Issue
Block a user