Skip to content

Commit 732fb45

Browse files
minrkCarreau
authored andcommitted
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 ab38ab6 commit 732fb45

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
@@ -562,7 +562,7 @@ def is_hidden(abs_path: str | Path, abs_root: str | Path = "") -> bool:
562562
if abs_root:
563563
abs_root = Path(os.path.normpath(abs_root))
564564
else:
565-
abs_root = Path(abs_path.root)
565+
abs_root = list(abs_path.parents)[-1]
566566

567567
if abs_path == abs_root:
568568
# root itself is never hidden

0 commit comments

Comments
 (0)