http://scons.tigris.org/issues/show_bug.cgi?id=2329
[scons.git] / src / engine / SCons / Scanner / FortranTests.py
index 82db69455bcdb084ae05f5daa290de7d10a2a95d..b75da5809211b9508d6e25cabd2a1b7d17a18285 100644 (file)
@@ -221,7 +221,7 @@ class DummyEnvironment:
             raise KeyError, "Dummy environment only has FORTRANPATH attribute."
 
     def has_key(self, key):
-        return self.Dictionary().has_key(key)
+        return key in self.Dictionary()
 
     def __getitem__(self,key):
         return self.Dictionary()[key]
@@ -238,9 +238,9 @@ class DummyEnvironment:
         return arg
 
     def subst_path(self, path, target=None, source=None, conv=None):
-        if type(path) != type([]):
+        if not isinstance(path, list):
             path = [path]
-        return map(self.subst, path)
+        return list(map(self.subst, path))
 
     def get_calculator(self):
         return None
@@ -255,8 +255,8 @@ class DummyEnvironment:
         return self.fs.File(filename)
 
 def deps_match(self, deps, headers):
-    scanned = map(os.path.normpath, map(str, deps))
-    expect = map(os.path.normpath, headers)
+    scanned = list(map(os.path.normpath, list(map(str, deps))))
+    expect = list(map(os.path.normpath, headers))
     self.failUnless(scanned == expect, "expect %s != scanned %s" % (expect, scanned))
 
 # define some tests:
@@ -364,7 +364,7 @@ class FortranScannerTestCase9(unittest.TestCase):
         deps = s(n, env, path)
 
         # Make sure rexists() got called on the file node being
-        # scanned, essential for cooperation with BuildDir functionality.
+        # scanned, essential for cooperation with VariantDir functionality.
         assert n.rexists_called
 
         headers =  ['d1/f3.f', 'f3.f']
@@ -382,7 +382,7 @@ class FortranScannerTestCase10(unittest.TestCase):
         env.fs.chdir(env.Dir(''))
         path = s.path(env, dir)
         deps2 = s(env.File('#fff4.f'), env, path)
-        headers1 =  map(test.workpath, ['include/f4.f'])
+        headers1 =  list(map(test.workpath, ['include/f4.f']))
         headers2 =  ['include/f4.f']
         deps_match(self, deps1, headers1)
         deps_match(self, deps2, headers2)
@@ -441,8 +441,8 @@ class FortranScannerTestCase14(unittest.TestCase):
     def runTest(self):
         os.chdir(test.workpath('work'))
         fs = SCons.Node.FS.FS(test.workpath('work'))
-        fs.BuildDir('build1', 'src', 1)
-        fs.BuildDir('build2', 'src', 0)
+        fs.VariantDir('build1', 'src', 1)
+        fs.VariantDir('build2', 'src', 0)
         fs.Repository(test.workpath('repository'))
         env = DummyEnvironment([])
         env.fs = fs
@@ -535,3 +535,9 @@ if __name__ == "__main__":
     result = runner.run(suite())
     if not result.wasSuccessful():
         sys.exit(1)
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: