On Python 3.12, distutils will be removed and it's currently (3.10+) deprecated (see PEP 632).
Since the suggested and simplest replacement is setuptools, this commit replaces distutils to use setuptools instead. Signed-off-by: Timothy Redaelli <[email protected]> --- python/setup.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/python/setup.py b/python/setup.py index cfe01763f..7c7418bd9 100644 --- a/python/setup.py +++ b/python/setup.py @@ -12,9 +12,8 @@ import sys -from distutils.command.build_ext import build_ext -from distutils.errors import CCompilerError, DistutilsExecError, \ - DistutilsPlatformError +from setuptools.command.build_ext import build_ext +from setuptools.errors import CCompilerError, ExecError, PlatformError import setuptools @@ -37,7 +36,7 @@ except IOError: file=sys.stderr) sys.exit(-1) -ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError) +ext_errors = (CCompilerError, ExecError, PlatformError) if sys.platform == 'win32': ext_errors += (IOError, ValueError) @@ -53,7 +52,7 @@ class try_build_ext(build_ext): def run(self): try: build_ext.run(self) - except DistutilsPlatformError: + except PlatformError: raise BuildFailed() def build_extension(self, ext): -- 2.36.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
