mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Revert "[BE][Easy] use pathlib.Path instead of dirname / ".." / pardir (#129374)"
This reverts commit 9e1f3ecaa710785a1ab03c6ad5093a5566d6c5e5. Reverted https://github.com/pytorch/pytorch/pull/129374 on behalf of https://github.com/huydhn due to Sorry for reverting your change but it is still failing with the same error ([comment](https://github.com/pytorch/pytorch/pull/129374#issuecomment-2197801405))
This commit is contained in:
@ -11,7 +11,6 @@ import urllib.error
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
# String representing the host platform (e.g. Linux, Darwin).
|
||||
HOST_PLATFORM = platform.system()
|
||||
HOST_PLATFORM_ARCH = platform.system() + "-" + platform.processor()
|
||||
@ -26,7 +25,10 @@ try:
|
||||
PYTORCH_ROOT = result.stdout.decode("utf-8").strip()
|
||||
except subprocess.CalledProcessError:
|
||||
# If git is not installed, compute repo root as 3 folders up from this file
|
||||
PYTORCH_ROOT = str(Path(__file__).absolute().parents[3])
|
||||
path_ = os.path.abspath(__file__)
|
||||
for _ in range(4):
|
||||
path_ = os.path.dirname(path_)
|
||||
PYTORCH_ROOT = path_
|
||||
|
||||
DRY_RUN = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user