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
2024-08-22 08:29:04 +00:00
committed by GitHub
parent 89be57ffc3
commit 4293c9f25f
7 changed files with 7 additions and 7 deletions
+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: