1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
From: Benjamin Drung <benjamin.drung@canonical.com>
Date: Wed, 20 Mar 2024 12:48:25 +0100
Subject: Replace deprecated distutils Python module
The Python module `distutils` is removed in Python 3.12.
Closes: #1065957
---
SConstruct | 4 ++--
python/setup.py | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/SConstruct b/SConstruct
index 2d70936..d093e6c 100644
--- a/SConstruct
+++ b/SConstruct
@@ -25,7 +25,7 @@
import sys
import os
-import distutils.sysconfig
+import sysconfig
str2bool = lambda s: s.lower() in ['true', '1', 't', 'y', 'yes', 'yeah', 'yup', 'on']
@@ -610,7 +610,7 @@ if configure.CheckHeader("ladspa.h", language="C") and getPlatform() == 'linux'
#
# install
-pydest = env['instdir'] + distutils.sysconfig.get_python_lib()
+pydest = env['instdir'] + sysconfig.get_path('platlib')
prefix = env['instdir'] + env['prefix']
print(env['instdir'])
diff --git a/python/setup.py b/python/setup.py
index 392b839..e09d825 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -1,4 +1,4 @@
-from distutils.core import setup
+from setuptools import setup
setup(name='SndObj',
version='2.6.99',
@@ -9,4 +9,3 @@ setup(name='SndObj',
packages=['sndobj'],
package_data={'sndobj': ['*.pyd', '*.dll', '*.lib', '*.exp']},
)
-
|