From 3c5dfb2dc4ee558a34d94a0c82aa0efa9bc39d74 Mon Sep 17 00:00:00 2001 From: Blady Date: Tue, 5 Aug 2025 20:56:54 +0200 Subject: [PATCH] Replace deprecated distutils.dep_util by setuptools.modified. --- share/plug-ins/show_globals.py | 4 ++-- share/support/core/expanded_code.py | 4 ++-- share/support/core/pre_processing_code.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/share/plug-ins/show_globals.py b/share/plug-ins/show_globals.py index 8ee5279723..bb7636d11a 100644 --- a/share/plug-ins/show_globals.py +++ b/share/plug-ins/show_globals.py @@ -3,7 +3,7 @@ by the GNATprove --flow-show-gg switch. """ -import distutils.dep_util +import setuptools.modified import json import os @@ -280,7 +280,7 @@ def show_generated_global_contracts(): ) gg_json = os.path.join(objdir, "gnatprove", unitname + ".gg") - if distutils.dep_util.newer(file.name(), gg_json): + if setuptools.modified.newer(file.name(), gg_json): prj = ' -P """%s"""' % project.file().name("Build_Server") scenario = project.scenario_variables_cmd_line("-X") cmd = COMMAND.format(project=prj, unit=file.base_name()) diff --git a/share/support/core/expanded_code.py b/share/support/core/expanded_code.py index 1499935984..a7a66f0927 100644 --- a/share/support/core/expanded_code.py +++ b/share/support/core/expanded_code.py @@ -5,7 +5,7 @@ import os -import distutils.dep_util +import setuptools.modified import GPS from gs_utils import in_ada_file, interactive @@ -197,7 +197,7 @@ def show_gnatdg(for_subprogram=False, in_external_editor=False): dg = os.path.join(objdir, os.path.basename(local_file)) + ".dg" - if distutils.dep_util.newer(local_file, dg): + if setuptools.modified.newer(local_file, dg): file_name = '"""%s"""' % file scenario = GPS.Project.root().scenario_variables_cmd_line("-X") cmd = "gprbuild -q %s -f -c -u -gnatcdx -gnatws -gnatGL" % prj diff --git a/share/support/core/pre_processing_code.py b/share/support/core/pre_processing_code.py index c52274f604..f1b79438f1 100644 --- a/share/support/core/pre_processing_code.py +++ b/share/support/core/pre_processing_code.py @@ -4,7 +4,7 @@ """ import os -import distutils.dep_util +import setuptools.modified import GPS from gs_utils import in_ada_file, interactive, hook @@ -102,7 +102,7 @@ def show_inactive_code(file_name, prep_name, for_subprogram=False): mode="error", ) # Do nothing is the .prep file is too old - elif distutils.dep_util.newer(file_name, prep_name): + elif setuptools.modified.newer(file_name, prep_name): GPS.Console("Messages").write( "The .prep file is too old," + " please recompile the ada file.\n", mode="error",