Skip to content

Commit

Permalink
Trac #32873: sage.features, sage_setup: Replace use of distutils.erro…
Browse files Browse the repository at this point in the history
…rs by setuptools

`setuptools.errors` available since
https://setuptools.pypa.io/en/latest/history.html#v59-0-0

See https://github.com/pypa/setuptools/pull/2858/files

URL: https://trac.sagemath.org/32873
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): François Bissey
  • Loading branch information
Release Manager committed Jan 30, 2022
2 parents 86d4d97 + 1c83bcd commit c85d230
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/sage/features/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,11 @@ def _is_present(self):
FeatureTestResult('empty', True)
"""
from sage.misc.temporary_file import tmp_filename
from distutils.errors import CCompilerError
try:
# Available since https://setuptools.pypa.io/en/latest/history.html#v59-0-0
from setuptools.errors import CCompilerError
except ImportError:
from distutils.errors import CCompilerError
with open(tmp_filename(ext=".pyx"), 'w') as pyx:
pyx.write(self.test_code)
from sage.misc.cython import cython_import
Expand Down
6 changes: 5 additions & 1 deletion src/sage_setup/command/sage_build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
from distutils import log
from setuptools.command.build_ext import build_ext
from distutils.dep_util import newer_group
from distutils.errors import DistutilsSetupError
try:
# Available since https://setuptools.pypa.io/en/latest/history.html#v59-0-0
from setuptools.errors import DistutilsSetupError
except ImportError:
from distutils.errors import DistutilsSetupError
from sage_setup.run_parallel import execute_list_of_commands

class sage_build_ext(build_ext):
Expand Down

0 comments on commit c85d230

Please sign in to comment.