From 8ee84f943560a542e18cb15df973c721561c789f Mon Sep 17 00:00:00 2001 From: GregNoel Date: Thu, 11 Sep 2008 18:38:24 +0000 Subject: [PATCH] Evaluate compat module transparently when SCons is instantiated git-svn-id: http://scons.tigris.org/svn/scons/trunk@3387 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Builder.py | 2 -- src/engine/SCons/Job.py | 2 -- src/engine/SCons/Node/__init__.py | 2 -- src/engine/SCons/SConf.py | 2 -- src/engine/SCons/SConsign.py | 2 -- src/engine/SCons/Script/Main.py | 2 -- src/engine/SCons/Script/SConsOptions.py | 2 -- src/engine/SCons/Subst.py | 2 -- src/engine/SCons/Taskmaster.py | 2 -- src/engine/SCons/Util.py | 2 -- src/engine/SCons/Variables/BoolVariable.py | 1 - src/engine/SCons/Variables/BoolVariableTests.py | 2 -- src/engine/SCons/Variables/PackageVariable.py | 1 - src/engine/SCons/Variables/PackageVariableTests.py | 2 -- src/engine/SCons/Variables/__init__.py | 2 -- src/engine/SCons/__init__.py | 3 +++ src/engine/SCons/compat/__init__.py | 6 +----- src/engine/SCons/cpp.py | 2 -- 18 files changed, 4 insertions(+), 35 deletions(-) diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py index 45bd99a1..977bdeaf 100644 --- a/src/engine/SCons/Builder.py +++ b/src/engine/SCons/Builder.py @@ -100,8 +100,6 @@ There are the following methods for internal use within this module: __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.compat - import UserDict import UserList diff --git a/src/engine/SCons/Job.py b/src/engine/SCons/Job.py index 545df98c..fec50aac 100644 --- a/src/engine/SCons/Job.py +++ b/src/engine/SCons/Job.py @@ -31,8 +31,6 @@ stop, and wait on jobs. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.compat - import os import signal diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index c765ee92..3a92b33c 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -44,8 +44,6 @@ be able to depend on any other type of "thing." __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.compat - import copy from itertools import chain, izip import string diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py index 9b3879eb..25fc2bcf 100644 --- a/src/engine/SCons/SConf.py +++ b/src/engine/SCons/SConf.py @@ -28,8 +28,6 @@ Autoconf-like configuration support. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.compat - import os import re import string diff --git a/src/engine/SCons/SConsign.py b/src/engine/SCons/SConsign.py index bd427061..b46d9adb 100644 --- a/src/engine/SCons/SConsign.py +++ b/src/engine/SCons/SConsign.py @@ -29,8 +29,6 @@ Writing and reading information to the .sconsign file or files. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.compat - import cPickle import os import os.path diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index 4a4dd84f..dc24b226 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -36,8 +36,6 @@ it goes here. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.compat - import os import os.path import string diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py index 2148068a..0e28fd29 100644 --- a/src/engine/SCons/Script/SConsOptions.py +++ b/src/engine/SCons/Script/SConsOptions.py @@ -23,8 +23,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.compat - import optparse import re import string diff --git a/src/engine/SCons/Subst.py b/src/engine/SCons/Subst.py index 52aaae54..8646f626 100644 --- a/src/engine/SCons/Subst.py +++ b/src/engine/SCons/Subst.py @@ -29,8 +29,6 @@ SCons string substitution. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.compat - import re import string import types diff --git a/src/engine/SCons/Taskmaster.py b/src/engine/SCons/Taskmaster.py index 27dd1f0f..61bab21e 100644 --- a/src/engine/SCons/Taskmaster.py +++ b/src/engine/SCons/Taskmaster.py @@ -50,8 +50,6 @@ interface and the SCons build engine. There are two key classes here: __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.compat - from itertools import chain import operator import string diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index af097864..44f615b6 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -29,8 +29,6 @@ Various utility functions go here. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.compat - import copy import os import os.path diff --git a/src/engine/SCons/Variables/BoolVariable.py b/src/engine/SCons/Variables/BoolVariable.py index 92936e6d..dd162cc1 100644 --- a/src/engine/SCons/Variables/BoolVariable.py +++ b/src/engine/SCons/Variables/BoolVariable.py @@ -40,7 +40,6 @@ __all__ = ['BoolVariable',] import string -import SCons.compat import SCons.Errors __true_strings = ('y', 'yes', 'true', 't', '1', 'on' , 'all' ) diff --git a/src/engine/SCons/Variables/BoolVariableTests.py b/src/engine/SCons/Variables/BoolVariableTests.py index feb4e4eb..ef681508 100644 --- a/src/engine/SCons/Variables/BoolVariableTests.py +++ b/src/engine/SCons/Variables/BoolVariableTests.py @@ -23,8 +23,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.compat - import sys import unittest diff --git a/src/engine/SCons/Variables/PackageVariable.py b/src/engine/SCons/Variables/PackageVariable.py index 6be260d8..bf74aadb 100644 --- a/src/engine/SCons/Variables/PackageVariable.py +++ b/src/engine/SCons/Variables/PackageVariable.py @@ -56,7 +56,6 @@ __all__ = ['PackageVariable',] import string -import SCons.compat import SCons.Errors __enable_strings = ('1', 'yes', 'true', 'on', 'enable', 'search') diff --git a/src/engine/SCons/Variables/PackageVariableTests.py b/src/engine/SCons/Variables/PackageVariableTests.py index 54116cf9..4adde2ea 100644 --- a/src/engine/SCons/Variables/PackageVariableTests.py +++ b/src/engine/SCons/Variables/PackageVariableTests.py @@ -23,8 +23,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.compat - import sys import unittest diff --git a/src/engine/SCons/Variables/__init__.py b/src/engine/SCons/Variables/__init__.py index a86cd34b..5a4a5573 100644 --- a/src/engine/SCons/Variables/__init__.py +++ b/src/engine/SCons/Variables/__init__.py @@ -29,8 +29,6 @@ customizable variables to an SCons build. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import SCons.compat - import os.path import string import sys diff --git a/src/engine/SCons/__init__.py b/src/engine/SCons/__init__.py index b5488419..86af342f 100644 --- a/src/engine/SCons/__init__.py +++ b/src/engine/SCons/__init__.py @@ -38,3 +38,6 @@ __buildsys__ = "__BUILDSYS__" __date__ = "__DATE__" __developer__ = "__DEVELOPER__" + +# make sure compatibility is always in place +import SCons.compat diff --git a/src/engine/SCons/compat/__init__.py b/src/engine/SCons/compat/__init__.py index 20fb8ede..59fdc3e3 100644 --- a/src/engine/SCons/compat/__init__.py +++ b/src/engine/SCons/compat/__init__.py @@ -29,11 +29,7 @@ implementations of various things that we'd like to use in SCons but which only show up in later versions of Python than the early, old version(s) we still support. -This package will be imported by other code: - - import SCons.compat - -But other code will not generally reference things in this package through +Other code will not generally reference things in this package through the SCons.compat namespace. The modules included here add things to the __builtin__ namespace or the global module list so that the rest of our code can use the objects and names imported here regardless of diff --git a/src/engine/SCons/cpp.py b/src/engine/SCons/cpp.py index cdd6a3a9..6ca5f9a9 100644 --- a/src/engine/SCons/cpp.py +++ b/src/engine/SCons/cpp.py @@ -27,8 +27,6 @@ __doc__ = """ SCons C Pre-Processor module """ -import SCons.compat - import os import re import string -- 2.26.2