mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-39897: Remove needless Path(self.parent)
call, which makes is_mount()
misbehave in Path
subclasses. (GH-18839)
This commit is contained in:
parent
75a3378810
commit
c746c4f353
1 changed files with 2 additions and 3 deletions
|
@ -1438,9 +1438,8 @@ class Path(PurePath):
|
||||||
if not self.exists() or not self.is_dir():
|
if not self.exists() or not self.is_dir():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
parent = Path(self.parent)
|
|
||||||
try:
|
try:
|
||||||
parent_dev = parent.stat().st_dev
|
parent_dev = self.parent.stat().st_dev
|
||||||
except OSError:
|
except OSError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -1448,7 +1447,7 @@ class Path(PurePath):
|
||||||
if dev != parent_dev:
|
if dev != parent_dev:
|
||||||
return True
|
return True
|
||||||
ino = self.stat().st_ino
|
ino = self.stat().st_ino
|
||||||
parent_ino = parent.stat().st_ino
|
parent_ino = self.parent.stat().st_ino
|
||||||
return ino == parent_ino
|
return ino == parent_ino
|
||||||
|
|
||||||
def is_symlink(self):
|
def is_symlink(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue