mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Remove distutils (#57040)
Summary: [distutils](https://docs.python.org/3/library/distutils.html) is on its way out and will be deprecated-on-import for Python 3.10+ and removed in Python 3.12 (see [PEP 632](https://www.python.org/dev/peps/pep-0632/)). There's no reason for us to keep it around since all the functionality we want from it can be found in `setuptools` / `sysconfig`. `setuptools` includes a copy of most of `distutils` (which is fine to use according to the PEP), that it uses under the hood, so this PR also uses that in some places. Fixes #56527 Pull Request resolved: https://github.com/pytorch/pytorch/pull/57040 Pulled By: driazati Reviewed By: nikithamalgifb Differential Revision: D28051356 fbshipit-source-id: 1ca312219032540e755593e50da0c9e23c62d720
This commit is contained in:
committed by
Facebook GitHub Bot
parent
21be40b390
commit
4b96fc060b
@ -5,11 +5,11 @@ import shutil
|
||||
from .setup_helpers.env import IS_64BIT, IS_WINDOWS, check_negative_env_flag
|
||||
from .setup_helpers.cmake import USE_NINJA
|
||||
|
||||
from setuptools import distutils
|
||||
|
||||
def _overlay_windows_vcvars(env):
|
||||
from distutils._msvccompiler import _get_vc_env
|
||||
vc_arch = 'x64' if IS_64BIT else 'x86'
|
||||
vc_env = _get_vc_env(vc_arch)
|
||||
vc_env = distutils._msvccompiler._get_vc_env(vc_arch)
|
||||
# Keys in `_get_vc_env` are always lowercase.
|
||||
# We turn them into uppercase before overlaying vcvars
|
||||
# because OS environ keys are always uppercase on Windows.
|
||||
|
Reference in New Issue
Block a user