Skip to content

Commit

Permalink
build: fix build with Python 3.12
Browse files Browse the repository at this point in the history
Replace `distutils.version.StrictVersion` with
`packaging.version.Version`.
  • Loading branch information
lpinca committed Nov 6, 2023
1 parent 9a321dd commit 66e9326
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import io
from pathlib import Path

from distutils.version import StrictVersion
from tools.gyp.pylib.packaging.version import Version

# If not run from node/, cd to node/.
os.chdir(Path(__file__).parent)
Expand Down Expand Up @@ -1566,10 +1566,10 @@ def without_ssl_error(option):
# supported asm compiler for AVX2. See https://github.com/openssl/openssl/
# blob/OpenSSL_1_1_0-stable/crypto/modes/asm/aesni-gcm-x86_64.pl#L52-L69
openssl110_asm_supported = \
('gas_version' in variables and StrictVersion(variables['gas_version']) >= StrictVersion('2.23')) or \
('xcode_version' in variables and StrictVersion(variables['xcode_version']) >= StrictVersion('5.0')) or \
('llvm_version' in variables and StrictVersion(variables['llvm_version']) >= StrictVersion('3.3')) or \
('nasm_version' in variables and StrictVersion(variables['nasm_version']) >= StrictVersion('2.10'))
('gas_version' in variables and Version(variables['gas_version']) >= Version('2.23')) or \
('xcode_version' in variables and Version(variables['xcode_version']) >= Version('5.0')) or \
('llvm_version' in variables and Version(variables['llvm_version']) >= Version('3.3')) or \
('nasm_version' in variables and Version(variables['nasm_version']) >= Version('2.10'))

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

0 comments on commit 66e9326

Please sign in to comment.