From bf5cef94e01760b712374ed01b488e22494e918b Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 7 Oct 2022 13:03:51 +0200 Subject: [PATCH 1/2] misc: replace deprecated distutils by setuptols or stdlib (#69991) --- setup.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 7c5071da..6ec7070c 100755 --- a/setup.py +++ b/setup.py @@ -6,12 +6,18 @@ import glob import os +import shutil import subprocess import sys -from distutils.cmd import Command -from distutils.command.build import build as _build -from distutils.errors import CompileError -from distutils.spawn import find_executable + +try: + from setuptools import Command + from setuptools.command.build import build as _build + from setuptools.errors import CompileError +except ImportError: + from distutils.cmd import Command + from distutils.command.build import build as _build + from distutils.errors import CompileError from setuptools import find_packages, setup from setuptools.command.install_lib import install_lib as _install_lib @@ -62,7 +68,7 @@ class compile_scss(Command): def run(self): sass_bin = None for program in ('sassc', 'sass'): - sass_bin = find_executable(program) + sass_bin = shutil.which(program) if sass_bin: break if not sass_bin: -- 2.37.2