summaryrefslogtreecommitdiffstats
path: root/Lib/pathlib.py
diff options
context:
space:
mode:
authorBarney Gale <barney.gale@gmail.com>2020-04-17 17:42:06 (GMT)
committerGitHub <noreply@github.com>2020-04-17 17:42:06 (GMT)
commitc746c4f353510a17683a49ed7f90ffaae664ff7b (patch)
tree6573fb3fa30ecb62e63542cd7e068cd64f4db412 /Lib/pathlib.py
parent75a3378810bab03949ad9f653f78d933bdf3879c (diff)
downloadcpython-c746c4f353510a17683a49ed7f90ffaae664ff7b.zip
cpython-c746c4f353510a17683a49ed7f90ffaae664ff7b.tar.gz
cpython-c746c4f353510a17683a49ed7f90ffaae664ff7b.tar.bz2
bpo-39897: Remove needless `Path(self.parent)` call, which makes `is_mount()` misbehave in `Path` subclasses. (GH-18839)
Diffstat (limited to 'Lib/pathlib.py')
-rw-r--r--Lib/pathlib.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/pathlib.py b/Lib/pathlib.py
index d2053e6..d3e89df 100644
--- a/Lib/pathlib.py
+++ b/Lib/pathlib.py
@@ -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):