Skip to content

Commit 0a5e9c1

Browse files
lpincaUlisesGascon
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 <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
1 parent 90f415d commit 0a5e9c1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎configure.py‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
importio
1515
frompathlibimportPath
1616

17-
fromdistutils.versionimportStrictVersion
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
fromgyp.commonimportGetFlavor
31+
frompackaging.versionimportVersion
3332

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

15731572
ifis_x86andnotopenssl110_asm_supported:
15741573
error('''Did not find a new enough assembler, install one or build with

0 commit comments

Comments
(0)