From: whitequark Date: Fri, 8 Oct 2021 17:48:00 +0000 (+0000) Subject: _toolchain.cxx: use distutils from setuptools. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f70256b094973e2e347a8dbe4a8136268626eac;p=nmigen.git _toolchain.cxx: use distutils from setuptools. The distutils module from the standard library is deprecated and will be removed in Python 3.12, and PEP 632 recommends using distutils.ccompiler from setuptools, instead. This code should eventually be rewritten to use zig-pypi, but for now this suffices. --- diff --git a/nmigen/_toolchain/cxx.py b/nmigen/_toolchain/cxx.py index 9b7fce2..430fb14 100644 --- a/nmigen/_toolchain/cxx.py +++ b/nmigen/_toolchain/cxx.py @@ -1,7 +1,7 @@ import tempfile import sysconfig import os.path -from distutils import ccompiler +from setuptools import distutils __all__ = ["build_cxx"] @@ -17,7 +17,7 @@ def build_cxx(*, cxx_sources, output_name, include_dirs, macros): # the output directory directly. os.chdir(build_dir.name) - cc_driver = ccompiler.new_compiler() + cc_driver = distutils.ccompiler.new_compiler() cc_driver.output_dir = "." cc = sysconfig.get_config_var("CC")