bpo-39897: Remove needless `Path(self.parent)` call, which makes `is_mount()` misbehave in `Path` subclasses. (GH-18839)

This commit is contained in:
Barney Gale 2020-04-17 18:42:06 +01:00 committed by GitHub
parent 75a3378810
commit c746c4f353
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -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):