]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-39897: Remove needless `Path(self.parent)` call, which makes `is_mount()` misbeha...
authorBarney Gale <barney.gale@gmail.com>
Fri, 17 Apr 2020 17:42:06 +0000 (18:42 +0100)
committerGitHub <noreply@github.com>
Fri, 17 Apr 2020 17:42:06 +0000 (19:42 +0200)
Lib/pathlib.py

index d2053e6284501ccde330b14cf453baed01e44ff4..d3e89dfbc88ac0b81bc44aa8d46379d8c33ee778 100644 (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):