Skip to content

Commit e8bbe79

Browse files
committed
Apply changes from CPython PR #18839 to PathPlus.is_mount()
1 parent d9249ce commit e8bbe79

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

domdf_python_tools/paths.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ def load_json(
645645
**kwargs,
646646
)
647647

648-
if sys.version_info < (3, 7): # pragma: no cover (<py37)
648+
if sys.version_info < (3, 10): # pragma: no cover (<py310)
649649

650650
def is_mount(self) -> bool:
651651
"""
@@ -659,17 +659,17 @@ def is_mount(self) -> bool:
659659
if not self.exists() or not self.is_dir():
660660
return False
661661

662-
parent = pathlib.Path(self.parent)
662+
# https://github.com/python/cpython/pull/18839/files
663663
try:
664-
parent_dev = parent.stat().st_dev
664+
parent_dev = self.parent.stat().st_dev
665665
except OSError:
666666
return False
667667

668668
dev = self.stat().st_dev
669669
if dev != parent_dev:
670670
return True
671671
ino = self.stat().st_ino
672-
parent_ino = parent.stat().st_ino
672+
parent_ino = self.parent.stat().st_ino
673673
return ino == parent_ino
674674

675675
if sys.version_info < (3, 8): # pragma: no cover (<py38)
@@ -793,7 +793,7 @@ def iterchildren(
793793
.. versionchanged:: 2.5.0 Added the ``matchcase`` option.
794794
"""
795795

796-
if not self.is_dir():
796+
if not self.abspath().is_dir():
797797
return
798798

799799
if exclude_dirs is None:

0 commit comments

Comments
 (0)