Fix exception causes all over the codebase (#90271)

This is the continuation to #90134 and hopefully the final PR in this series.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/90271
Approved by: https://github.com/kit1980
This commit is contained in:
Ram Rachum
2022-12-07 04:28:56 +00:00
committed by PyTorch MergeBot
parent 8f079b895b
commit 351d73b97f
63 changed files with 150 additions and 147 deletions

View File

@ -1,9 +1,9 @@
try:
from urllib.parse import urlparse, urlunparse
except ImportError:
except ImportError as e:
raise ImportError(
"urllib cannot be found, urlparse from python2 is no longer supported."
)
) from e
import numbers
import os