[BE] Remove dependency on six and future (#94709)

Remove the Python 2 and 3 compatibility library [six](https://pypi.org/project/six) and [future](https://pypi.org/project/future) and `torch._six`. We only support Python 3.8+ now. It's time to retire them.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/94709
Approved by: https://github.com/malfet, https://github.com/Skylion007
This commit is contained in:
Xuehai Pan
2023-02-14 09:14:10 +00:00
committed by PyTorch MergeBot
parent 39511697d4
commit b005ec62b9
73 changed files with 108 additions and 195 deletions

View File

@ -11,7 +11,6 @@ import sys
from datetime import timedelta
from typing import Dict, Optional
import torch._six as six
from torch.distributed import FileStore, PrefixStore, Store, TCPStore
from .constants import default_pg_timeout
@ -91,7 +90,7 @@ def _rendezvous_helper(url: str, rank: int, world_size_opt: Optional[int], **kwa
def rendezvous(url: str, rank: int = -1, world_size: int = -1, **kwargs):
if not isinstance(url, six.string_classes):
if not isinstance(url, str):
raise RuntimeError("`url` must be a string. {}: {}".format(type(url), url))
if not isinstance(rank, numbers.Integral):