diff options
| author | Luca Falavigna <dktrkranz@debian.org> | 2010-06-15 14:28:22 +0000 | 
|---|---|---|
| committer | Luca Falavigna <dktrkranz@debian.org> | 2010-06-15 14:28:22 +0000 | 
| commit | 738149c9bfb9965d013d01ef99f9bb1c2819e7e8 (patch) | |
| tree | 0397d9bf3b12c903dc73419585df231397ff343c /src/engine/SCons/SConfTests.py | |
| parent | e7885e3af440eaef38a9301fd92a105afc8ddebb (diff) | |
Imported Upstream version 2.0.0upstream/2.0.0
Diffstat (limited to 'src/engine/SCons/SConfTests.py')
| -rw-r--r-- | src/engine/SCons/SConfTests.py | 25 | 
1 files changed, 13 insertions, 12 deletions
diff --git a/src/engine/SCons/SConfTests.py b/src/engine/SCons/SConfTests.py index 9ba82f2..91c57d2 100644 --- a/src/engine/SCons/SConfTests.py +++ b/src/engine/SCons/SConfTests.py @@ -21,19 +21,20 @@  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  # -__revision__ = "src/engine/SCons/SConfTests.py 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/SConfTests.py 5023 2010/06/14 22:05:46 scons" +import SCons.compat + +import io  import os  import re -import string -import StringIO  import sys  from types import *  import unittest  import TestCmd -sys.stdout = StringIO.StringIO() +sys.stdout = io.StringIO()  if sys.platform == 'win32':      existing_lib = "msvcrt" @@ -60,9 +61,9 @@ class SConfTestCase(unittest.TestCase):          import SCons.SConsign          SCons.SConsign.write() # simulate normal scons-finish          for n in sys.modules.keys(): -            if string.split(n, '.')[0] == 'SCons' and n[:12] != 'SCons.compat': +            if n.split('.')[0] == 'SCons' and n[:12] != 'SCons.compat':                  m = sys.modules[n] -                if type(m) is ModuleType: +                if isinstance(m, ModuleType):                      # if this is really a scons module, clear its namespace                      del sys.modules[n]                      m.__dict__.clear() @@ -84,7 +85,7 @@ class SConfTestCase(unittest.TestCase):          if (not self.scons_env.Detect( self.scons_env.subst('$CXX') ) or              not self.scons_env.Detect( self.scons_env.subst('$CC') ) or              not self.scons_env.Detect( self.scons_env.subst('$LINK') )): -            raise Exception, "This test needs an installed compiler!" +            raise Exception("This test needs an installed compiler!")          if self.scons_env['CXX'] == 'g++':              global existing_lib              existing_lib = 'm' @@ -97,11 +98,11 @@ class SConfTestCase(unittest.TestCase):               # original builtin functions whenever we have to reset               # all of our global state. -             import __builtin__ +             import builtins               import SCons.Platform.win32 -             __builtin__.file = SCons.Platform.win32._builtin_file -             __builtin__.open = SCons.Platform.win32._builtin_open +             builtins.file = SCons.Platform.win32._builtin_file +             builtins.open = SCons.Platform.win32._builtin_open      def _baseTryXXX(self, TryFunc):          # TryCompile and TryLink are much the same, so we can test them @@ -174,7 +175,7 @@ class SConfTestCase(unittest.TestCase):                  self.prefix = ''                  self.suffix = ''              def __call__(self, env, target, source): -                class MyNode: +                class MyNode(object):                      def __init__(self, name):                          self.name = name                          self.state = None @@ -221,7 +222,7 @@ class SConfTestCase(unittest.TestCase):                      def do_not_store_info(self):                          pass                      def get_executor(self): -                        class Executor: +                        class Executor(object):                              def __init__(self, targets):                                  self.targets = targets                              def get_all_targets(self):  | 
