mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Remove unused Python variables in torch/[_-a]* (#133492)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/133492 Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
2268319596
commit
fda975a7b3
@ -438,8 +438,7 @@ def write(
|
||||
# hashes just because the content begins/ends with different number of
|
||||
# spaces.
|
||||
key: str = get_hash(content.strip(), extra, hash_type)
|
||||
basename, subdir, path = get_path(key, extension, specified_dir)
|
||||
encode_utf_8: bool = hash_type == "code"
|
||||
basename, _subdir, path = get_path(key, extension, specified_dir)
|
||||
if not os.path.exists(path):
|
||||
write_atomic(path, content, make_dirs=True)
|
||||
return basename, path
|
||||
@ -472,7 +471,7 @@ def write_atomic(
|
||||
f.write(content)
|
||||
try:
|
||||
tmp_path.rename(target=path)
|
||||
except FileExistsError as e_file_exist:
|
||||
except FileExistsError:
|
||||
if not _IS_WINDOWS:
|
||||
raise
|
||||
# On Windows file exist is expected: https://docs.python.org/3/library/pathlib.html#pathlib.Path.rename
|
||||
|
Reference in New Issue
Block a user