Skip to content

Commit

Permalink
indexerror finding filesystem root
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakers-the-rat committed Sep 25, 2024
1 parent 5a7e2e2 commit fe2dbdc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ def test_relative_to_root_dir():
beneath the root directory (eg `/data`) even if they exist
"""
root = Path().resolve().parents[-1]
try:
root = Path().resolve().parents[-1]
except IndexError:
root = Path("/").resolve()

test_path = None
for path in root.iterdir():
if path.is_dir():
Expand Down

0 comments on commit fe2dbdc

Please sign in to comment.