From 3565b5351dd5a775a432e8610754bc0844112ce9 Mon Sep 17 00:00:00 2001 From: Christian Krieg Date: Tue, 20 Feb 2024 06:10:36 +0100 Subject: [PATCH 1/2] Fix "ModuleNotFoundError" for bdist_wheel on Python 3.12 --- setuptools/_distutils/util.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setuptools/_distutils/util.py b/setuptools/_distutils/util.py index 7ae914f7ee..777a4350eb 100644 --- a/setuptools/_distutils/util.py +++ b/setuptools/_distutils/util.py @@ -430,6 +430,7 @@ def byte_compile( # noqa: C901 with script: script.write( """\ +import setuptools from distutils.util import byte_compile files = [ """ From 1ff629fe9feb417cb3f9bf25df6450e80815bfac Mon Sep 17 00:00:00 2001 From: Christian Krieg Date: Tue, 20 Feb 2024 06:29:29 +0100 Subject: [PATCH 2/2] Added news fragment --- newsfragments/4229.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/4229.bugfix.rst diff --git a/newsfragments/4229.bugfix.rst b/newsfragments/4229.bugfix.rst new file mode 100644 index 0000000000..9f71497bf3 --- /dev/null +++ b/newsfragments/4229.bugfix.rst @@ -0,0 +1 @@ +Fixed distutils ``ModuleNotFoundError`` for ``setup.py bdist_wheel`` on Python 3.12 -- by :user:`christian-krieg`