Skip to content

Commit 22eb025

Browse files
lpincatargos
authored andcommitted
build: fix build with Python 3.12
Replace `distutils.version.StrictVersion` with `packaging.version.Version`. Refs: #50209 (comment) PR-URL: #50582 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 931e1e7 commit 22eb025

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

configure.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import io
1515
from pathlib import Path
1616

17-
from distutils.version import StrictVersion
18-
1917
# If not run from node/, cd to node/.
2018
os.chdir(Path(__file__).parent)
2119

@@ -30,6 +28,7 @@
3028

3129
sys.path.insert(0, str(tools_path / 'gyp' / 'pylib'))
3230
from gyp.common import GetFlavor
31+
from packaging.version import Version
3332

3433
# imports in tools/configure.d
3534
sys.path.insert(0, str(tools_path / 'configure.d'))
@@ -1566,10 +1565,10 @@ def without_ssl_error(option):
15661565
# supported asm compiler for AVX2. See https://github.com/openssl/openssl/
15671566
# blob/OpenSSL_1_1_0-stable/crypto/modes/asm/aesni-gcm-x86_64.pl#L52-L69
15681567
openssl110_asm_supported = \
1569-
('gas_version' in variables and StrictVersion(variables['gas_version']) >= StrictVersion('2.23')) or \
1570-
('xcode_version' in variables and StrictVersion(variables['xcode_version']) >= StrictVersion('5.0')) or \
1571-
('llvm_version' in variables and StrictVersion(variables['llvm_version']) >= StrictVersion('3.3')) or \
1572-
('nasm_version' in variables and StrictVersion(variables['nasm_version']) >= StrictVersion('2.10'))
1568+
('gas_version' in variables and Version(variables['gas_version']) >= Version('2.23')) or \
1569+
('xcode_version' in variables and Version(variables['xcode_version']) >= Version('5.0')) or \
1570+
('llvm_version' in variables and Version(variables['llvm_version']) >= Version('3.3')) or \
1571+
('nasm_version' in variables and Version(variables['nasm_version']) >= Version('2.10'))
15731572

15741573
if is_x86 and not openssl110_asm_supported:
15751574
error('''Did not find a new enough assembler, install one or build with

0 commit comments

Comments
 (0)