diff options
author | Greg Noel <GregNoel@tigris.org> | 2010-03-27 07:39:52 (GMT) |
---|---|---|
committer | Greg Noel <GregNoel@tigris.org> | 2010-03-27 07:39:52 (GMT) |
commit | 59ed0a109bf5add2efcef459080837b11066c6fb (patch) | |
tree | fff879b4f9676a72e16c0f7b4dd969f050038b4f /src/engine/SCons/ActionTests.py | |
parent | 00a3188193ba1feef927cf18e7f5fc20ad71b848 (diff) | |
download | SCons-59ed0a109bf5add2efcef459080837b11066c6fb.zip SCons-59ed0a109bf5add2efcef459080837b11066c6fb.tar.gz SCons-59ed0a109bf5add2efcef459080837b11066c6fb.tar.bz2 |
http://scons.tigris.org/issues/show_bug.cgi?id=2329
Applied a number of idiomatic changes.
Uses of the 'sort()' method were converted into calls of 'sorted()' when
possible and the sorted() expression was inserted into a subsequent statement
whenever that made sense.
The statement 'while 1:' was changed to 'while True:'.
Names from the 'types' module (e.g., 'types.FooType') were converted to the
equivalent build-in type (e.g., 'foo').
Comparisons between types were changed to use 'isinstance()'.
Diffstat (limited to 'src/engine/SCons/ActionTests.py')
-rw-r--r-- | src/engine/SCons/ActionTests.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py index 12756e5..052582b 100644 --- a/src/engine/SCons/ActionTests.py +++ b/src/engine/SCons/ActionTests.py @@ -304,7 +304,9 @@ class ActionTestCase(unittest.TestCase): # a singleton list returns the contained action test_positional_args(cmd_action, ["string"]) - if hasattr(types, 'UnicodeType'): + try: unicode + except NameError: pass + else: a2 = eval("SCons.Action.Action(u'string')") assert isinstance(a2, SCons.Action.CommandAction), a2 @@ -540,18 +542,18 @@ class _ActionActionTestCase(unittest.TestCase): env = Environment() def execfunc(target, source, env): - assert type(target) is type([]), type(target) - assert type(source) is type([]), type(source) + assert isinstance(target, list), type(target) + assert isinstance(source, list), type(source) return 7 a = SCons.Action.Action(execfunc) def firstfunc(target, source, env): - assert type(target) is type([]), type(target) - assert type(source) is type([]), type(source) + assert isinstance(target, list), type(target) + assert isinstance(source, list), type(source) return 0 def lastfunc(target, source, env): - assert type(target) is type([]), type(target) - assert type(source) is type([]), type(source) + assert isinstance(target, list), type(target) + assert isinstance(source, list), type(source) return 9 b = SCons.Action.Action([firstfunc, execfunc, lastfunc]) |