diff options
Diffstat (limited to 'test/Errors')
-rw-r--r-- | test/Errors/InternalError.py | 2 | ||||
-rw-r--r-- | test/Errors/UserError.py | 2 | ||||
-rw-r--r-- | test/Errors/execute-a-directory.py | 3 | ||||
-rw-r--r-- | test/Errors/non-executable-file.py | 3 | ||||
-rw-r--r-- | test/Errors/nonexistent-executable.py | 3 |
5 files changed, 5 insertions, 8 deletions
diff --git a/test/Errors/InternalError.py b/test/Errors/InternalError.py index 032c7a7..49d9fdd 100644 --- a/test/Errors/InternalError.py +++ b/test/Errors/InternalError.py @@ -35,7 +35,7 @@ test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) # Test InternalError. test.write('SConstruct', """ -assert not globals().has_key("InternalError") +assert "InternalError" not in globals() from SCons.Errors import InternalError raise InternalError, 'error inside' """) diff --git a/test/Errors/UserError.py b/test/Errors/UserError.py index c534ed6..0212a52 100644 --- a/test/Errors/UserError.py +++ b/test/Errors/UserError.py @@ -34,7 +34,7 @@ import TestSCons test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) test.write('SConstruct', """ -assert not globals().has_key("UserError") +assert "UserError" not in globals() import SCons.Errors raise SCons.Errors.UserError, 'Depends() requires both sources and targets.' """) diff --git a/test/Errors/execute-a-directory.py b/test/Errors/execute-a-directory.py index e02dcb0..bf2c246 100644 --- a/test/Errors/execute-a-directory.py +++ b/test/Errors/execute-a-directory.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os -import string import TestSCons @@ -41,7 +40,7 @@ test.write('SConstruct', r""" bld = Builder(action = '%s $SOURCES $TARGET') env = Environment(BUILDERS = { 'bld' : bld }) env.bld(target = 'f3', source = 'f3.in') -""" % string.replace(test.workdir, '\\', '\\\\')) +""" % test.workdir.replace('\\', '\\\\')) test.run(arguments='.', stdout = test.wrap_stdout("%s f3.in f3\n" % test.workdir, error=1), diff --git a/test/Errors/non-executable-file.py b/test/Errors/non-executable-file.py index dc6b606..e51dc85 100644 --- a/test/Errors/non-executable-file.py +++ b/test/Errors/non-executable-file.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os -import string import TestSCons @@ -72,7 +71,7 @@ test.write('SConstruct', r""" bld = Builder(action = '%s $SOURCES $TARGET') env = Environment(BUILDERS = { 'bld': bld }) env.bld(target = 'f1', source = 'f1.in') -""" % string.replace(not_executable, '\\', '\\\\')) +""" % not_executable.replace('\\', '\\\\')) test.run(arguments='.', stdout = test.wrap_stdout("%s f1.in f1\n" % not_executable, error=1), diff --git a/test/Errors/nonexistent-executable.py b/test/Errors/nonexistent-executable.py index ab6d118..1272e81 100644 --- a/test/Errors/nonexistent-executable.py +++ b/test/Errors/nonexistent-executable.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os -import string import TestSCons @@ -39,7 +38,7 @@ test.write('SConstruct', r""" bld = Builder(action = '%s $SOURCES $TARGET') env = Environment(BUILDERS = { 'bld' : bld }) env.bld(target = 'f1', source = 'f1.in') -""" % string.replace(no_such_file, '\\', '\\\\')) +""" % no_such_file.replace('\\', '\\\\')) test.run(arguments='.', stdout = test.wrap_stdout("%s f1.in f1\n" % no_such_file, error=1), |