From 95bc5073c00753b01f9099eee2ed73fcb35af353 Mon Sep 17 00:00:00 2001 From: Evan Tang Date: Mon, 6 Nov 2023 13:32:19 -0600 Subject: [PATCH] Python 3.12 compatibility --- scripts/build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/build.py b/scripts/build.py index 3284729ce2..051ea911ad 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -25,7 +25,7 @@ ''' import argparse -import distutils.version +import packaging.version import os import platform import re @@ -53,10 +53,10 @@ def is_mac(): BUILD_ROOT = os.path.abspath( os.path.join(os.path.split(os.path.abspath(__file__))[0], '..')) BUILD_CONFIGS = {'debug': 'dbuild', 'release': 'build'} -CMAKE_VERSION_3_13 = distutils.version.StrictVersion('3.13.0') +CMAKE_VERSION_3_13 = packaging.version.parse('3.13.0') CONFIGURATIONS = ['release', 'debug'] DEFAULT_CONFIGURATION = CONFIGURATIONS[0] -VERSION = distutils.version.StrictVersion('0.0.0') +VERSION = packaging.version.parse('0.0.0') class BuildError(Exception): @@ -194,7 +194,7 @@ def cmake_version(): r'cmake version (?P[\d\.]+)', cmake_version_output) if match is None: raise BuildError('failed to get CMake version') - cmake_version = distutils.version.StrictVersion(match.group('version')) + cmake_version = packaging.version.parse(match.group('version')) return cmake_version