Switch python syntax to use Path.parents (#4235)

I think `paths.parents[2]` is easier to read than
`path.parent.parent.parent`, just applying uniformly. I'd noticed this
while looking at #4227

Also remove a couple `resolve()` calls that shouldn't be necessary since
`__file__` is absolute (elsewhere in the same files, `resolve()` is used
to resolve potentially relative paths)
This commit is contained in:
Jon Ross-Perkins authored and GitHub committed 2024-08-22 08:29:04 +00:00
1 parent 89be57ffc3
commit 4293c9f25f
7 files changed
+7 -7

No files matched your search

+1 -1
View File
@@ -94,7 +94,7 @@ def chdir_repo_root() -> None:
This is done so that scripts run from a consistent directory.
"""
os.chdir(Path(__file__).parent.parent)
os.chdir(Path(__file__).parents[1])
def _get_hash(file: Path) -> str: