From: whitequark Date: Fri, 8 Oct 2021 17:48:00 +0000 (+0000) Subject: _toolchain.cxx: ignore another deprecation warning (on Python 3.10). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cfed63d814b11bbea3ce0b52d0f7f6b91ec8cc66;p=nmigen.git _toolchain.cxx: ignore another deprecation warning (on Python 3.10). Sigh. --- diff --git a/nmigen/_toolchain/cxx.py b/nmigen/_toolchain/cxx.py index c43ffbc..439011c 100644 --- a/nmigen/_toolchain/cxx.py +++ b/nmigen/_toolchain/cxx.py @@ -4,12 +4,6 @@ import warnings import os.path -with warnings.catch_warnings(): - warnings.filterwarnings(action="ignore", category=DeprecationWarning) - # this causes a DeprecationWarning on Python 3.6 (but not later) - from setuptools import distutils - - __all__ = ["build_cxx"] @@ -23,7 +17,12 @@ def build_cxx(*, cxx_sources, output_name, include_dirs, macros): # the output directory directly. os.chdir(build_dir.name) - cc_driver = distutils.ccompiler.new_compiler() + with warnings.catch_warnings(): + warnings.filterwarnings(action="ignore", category=DeprecationWarning) + # This emits a DeprecationWarning on Python 3.6 and 3.10. + from setuptools import distutils + cc_driver = distutils.ccompiler.new_compiler() + cc_driver.output_dir = "." cc = sysconfig.get_config_var("CC")