From 991c022c301f2bd2aa3bc3d7b0b0bef9f2e9da82 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Sun, 4 Sep 2022 19:14:14 +0300 Subject: Make EnsurePythonVersion static too --- CHANGES.txt | 3 ++- SCons/Script/SConscript.py | 3 ++- SCons/Script/__init__.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index d46a5d1..d26b78c 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -24,7 +24,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Fixed runtest.py failure on Windows caused by excessive escaping of the path to python.exe. From Anatoli Babenia - - Do not initialize DefaultEnvironment when calling EnsureSConsVersion() + - Do not initialize DefaultEnvironment when calling EnsureSConsVersion() and + EnsurePythonVersion(). RELEASE 4.4.0 - Sat, 30 Jul 2022 14:08:29 -0700 diff --git a/SCons/Script/SConscript.py b/SCons/Script/SConscript.py index a85c12c..99bb84d 100644 --- a/SCons/Script/SConscript.py +++ b/SCons/Script/SConscript.py @@ -507,7 +507,8 @@ class SConsEnvironment(SCons.Environment.Base): (scons_ver_string, SCons.__version__)) sys.exit(2) - def EnsurePythonVersion(self, major, minor): + @staticmethod + def EnsurePythonVersion(major, minor): """Exit abnormally if the Python version is not late enough.""" if sys.version_info < (major, minor): v = sys.version.split()[0] diff --git a/SCons/Script/__init__.py b/SCons/Script/__init__.py index 029dc8e..0250bd1 100644 --- a/SCons/Script/__init__.py +++ b/SCons/Script/__init__.py @@ -291,13 +291,13 @@ def Variables(files=None, args=ARGUMENTS): # # Static functions that do not use state in DefaultEnvironment(). EnsureSConsVersion = _SConscript.SConsEnvironment.EnsureSConsVersion +EnsurePythonVersion = _SConscript.SConsEnvironment.EnsurePythonVersion # Functions that end up calling methods or Builders in the # DefaultEnvironment(). GlobalDefaultEnvironmentFunctions = [ # Methods from the SConsEnvironment class, above. 'Default', - 'EnsurePythonVersion', 'Exit', 'Export', 'GetLaunchDir', -- cgit v0.12