Skip to content

Commit d285450

Browse files
committed
get last parent for default root
Windows is more complex since it combines root and drive to be absolute cast to list because parents[-1] is new in 3.10
1 parent 0d44430 commit d285450

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jupyter_core/paths.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ def is_hidden(abs_path: str | Path, abs_root: str | Path = "") -> bool:
550550
if abs_root:
551551
abs_root = Path(os.path.normpath(abs_root))
552552
else:
553-
abs_root = Path(abs_path.root)
553+
abs_root = list(abs_path.parents)[-1]
554554

555555
if abs_path == abs_root:
556556
# root itself is never hidden

0 commit comments

Comments
 (0)