Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
src/sage/features/__init__.py: Try import from setuptools.errors befo…
Browse files Browse the repository at this point in the history
…re distutils.errors
  • Loading branch information
Matthias Koeppe committed Nov 15, 2021
1 parent f211926 commit 1c83bcd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sage/features/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,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

0 comments on commit 1c83bcd

Please sign in to comment.