mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Update ruff linter for PEP585 (#147540)
This turns on PEP585 enforcement in RUFF. - Updates the target python version - Stops ignoring UP006 warnings (PEP585) - Fixes a few issues which crept into the tree in the last day Pull Request resolved: https://github.com/pytorch/pytorch/pull/147540 Approved by: https://github.com/justinchuby, https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
77d2780657
commit
086d146f6f
@ -1606,9 +1606,12 @@ def _legacy_load(f, map_location, pickle_module, **pickle_load_args):
|
||||
return saved_id[0]
|
||||
return deserialized_objects[int(saved_id)]
|
||||
|
||||
with closing(
|
||||
tarfile.open(fileobj=f, mode="r:", format=tarfile.PAX_FORMAT)
|
||||
) as tar, mkdtemp() as tmpdir:
|
||||
with (
|
||||
closing(
|
||||
tarfile.open(fileobj=f, mode="r:", format=tarfile.PAX_FORMAT)
|
||||
) as tar,
|
||||
mkdtemp() as tmpdir,
|
||||
):
|
||||
if pickle_module is _weights_only_unpickler:
|
||||
raise RuntimeError(
|
||||
"Cannot use ``weights_only=True`` with files saved in the "
|
||||
|
Reference in New Issue
Block a user