mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-27 08:21:13 +00: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:
1 parent
89be57ffc3
commit
4293c9f25f
7 files changed
+7
-7
No files matched your search
@@ -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