mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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():
|
||||
return False
|
||||
|
||||
parent = Path(self.parent)
|
||||
try:
|
||||
parent_dev = parent.stat().st_dev
|
||||
parent_dev = self.parent.stat().st_dev
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
|
@ -1448,7 +1447,7 @@ class Path(PurePath):
|
|||
if dev != parent_dev:
|
||||
return True
|
||||
ino = self.stat().st_ino
|
||||
parent_ino = parent.stat().st_ino
|
||||
parent_ino = self.parent.stat().st_ino
|
||||
return ino == parent_ino
|
||||
|
||||
def is_symlink(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue