From 4eb804194d7c032e8da2b62819c75aaee31f1fb1 Mon Sep 17 00:00:00 2001 From: Bruno Pitrus Date: Tue, 25 Jul 2023 17:39:21 +0200 Subject: [PATCH] Replace uses of python `distutils` library It is not available anymore in Python 3.12: https://peps.python.org/pep-0632/ --- gyp/pylib/gyp/input.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gyp/pylib/gyp/input.py b/gyp/pylib/gyp/input.py index d9699a0a50..173e94656b 100644 --- a/gyp/pylib/gyp/input.py +++ b/gyp/pylib/gyp/input.py @@ -16,7 +16,7 @@ import sys import threading import traceback -from distutils.version import StrictVersion +from packaging.version import Version from gyp.common import GypError from gyp.common import OrderedSet @@ -1183,7 +1183,7 @@ def EvalSingleCondition(cond_expr, true_dict, false_dict, phase, variables, buil else: ast_code = compile(cond_expr_expanded, "", "eval") cached_conditions_asts[cond_expr_expanded] = ast_code - env = {"__builtins__": {}, "v": StrictVersion} + env = {"__builtins__": {}, "v": Version} if eval(ast_code, env, variables): return true_dict return false_dict