From 8081df1265c3a310602975c132c1da13667aebcc Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 8 Oct 2021 17:48:00 +0000 Subject: [PATCH] _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. --- nmigen/_toolchain/cxx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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")