mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Use absolute path path.resolve()
-> path.absolute()
(#129409)
Changes: 1. Always explicit `.absolute()`: `Path(__file__)` -> `Path(__file__).absolute()` 2. Replace `path.resolve()` with `path.absolute()` if the code is resolving the PyTorch repo root directory. Pull Request resolved: https://github.com/pytorch/pytorch/pull/129409 Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
362ecad9bb
commit
135c7db99d
@ -182,7 +182,7 @@ def check_file(
|
||||
|
||||
for match in RESULTS_RE.finditer(proc.stdout.decode()):
|
||||
# Convert the reported path to an absolute path.
|
||||
abs_path = str(Path(match["file"]).resolve())
|
||||
abs_path = str(Path(match["file"]).absolute())
|
||||
message = LintMessage(
|
||||
path=abs_path,
|
||||
name=match["code"],
|
||||
@ -262,7 +262,7 @@ def main() -> None:
|
||||
print(json.dumps(err_msg._asdict()), flush=True)
|
||||
sys.exit(0)
|
||||
|
||||
abs_build_dir = Path(args.build_dir).resolve()
|
||||
abs_build_dir = Path(args.build_dir).absolute()
|
||||
|
||||
# Get the absolute path to clang-tidy and use this instead of the relative
|
||||
# path such as .lintbin/clang-tidy. The problem here is that os.chdir is
|
||||
|
Reference in New Issue
Block a user