# HG changeset patch # User Mads Kiilerich # Date 2023-06-27 10:09:17 # Node ID b1ac55606eb7886d3c092ab1a913a41523680c57 # Parent b3a5af04da35c87f7a31398b652e9dc93b9ab817 setup: fall back to setuptools setup if distutils isn't available The setuptools comments around this seems slightly outdated. Setuptools is improving and distutils is being deprecated, so it should perhaps be the default. But at least, it is a fair fallback. diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -112,7 +112,10 @@ issetuptools = os.name == 'nt' or 'FORCE if issetuptools: from setuptools import setup else: - from distutils.core import setup + try: + from distutils.core import setup + except ModuleNotFoundError: + from setuptools import setup from distutils.ccompiler import new_compiler from distutils.core import Command, Extension from distutils.dist import Distribution