mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:44:41 +01:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user