Skip to content

Commit

Permalink
Fix compatibility with Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Takishima committed Apr 2, 2024
1 parent 145b60b commit 57fed69
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,16 @@
import subprocess
import sys
import tempfile
from distutils.cmd import Command
from distutils.errors import (
CCompilerError,
CompileError,
DistutilsExecError,
DistutilsPlatformError,
LinkError,
)
from distutils.spawn import find_executable, spawn
from operator import itemgetter
from pathlib import Path

from setuptools import Command
from setuptools import Distribution as _Distribution
from setuptools import Extension, setup
from setuptools._distutils.errors import CompileError, DistutilsError
from setuptools.command.build_ext import build_ext
from setuptools.errors import CCompilerError, LinkError, PlatformError

try:
import setuptools_scm # noqa: F401 # pylint: disable=unused-import
Expand Down Expand Up @@ -277,7 +272,7 @@ def __init__(self):
# Python build related variable

cpython = platform.python_implementation() == 'CPython'
ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)
ext_errors = (CCompilerError, DistutilsError, CompileError)
if sys.platform == 'win32':
# 2.6's distutils.msvc9compiler can raise an IOError when failing to
# find the compiler
Expand Down Expand Up @@ -335,7 +330,7 @@ def run(self):
"""Execute this command."""
try:
build_ext.run(self)
except DistutilsPlatformError as err:
except PlatformError as err:
raise BuildFailed() from err

def build_extensions(self):
Expand Down

0 comments on commit 57fed69

Please sign in to comment.