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 /test/ZIP/ZIP.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 'test/ZIP/ZIP.py')
-rw-r--r-- | test/ZIP/ZIP.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/ZIP/ZIP.py b/test/ZIP/ZIP.py index 73e7810..f9ba417 100644 --- a/test/ZIP/ZIP.py +++ b/test/ZIP/ZIP.py @@ -49,6 +49,8 @@ import os.path import sys def process(outfile, name): if os.path.isdir(name): + ## TODO 2.5: the next three lines can be replaced by + #for entry in sorted(os.listdir(name)): list = os.listdir(name) list.sort() for entry in list: @@ -115,10 +117,9 @@ if zip: test.write('SConstruct', """\ def marker(target, source, env): open(r'%s', 'wb').write("marker\\n") -import types f1 = Environment() zipcom = f1.Dictionary('ZIPCOM') -if not type(zipcom) is types.ListType: +if not isinstance(zipcom, list): zipcom = [zipcom] f2 = Environment(ZIPCOM = [Action(marker)] + zipcom) f3 = Environment(ZIPSUFFIX = '.xyzzy') |