diff options
author | Steven Knight <knight@baldmt.com> | 2010-04-18 14:03:36 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2010-04-18 14:03:36 (GMT) |
commit | ae1e7c742dcd1ed0b521640455794172fe275c65 (patch) | |
tree | 15f668e70035c926caa062d91f2fd806b7b65528 /test/Parallel | |
parent | e254cdf344ed0a466661b319dc019f2400ad12f3 (diff) | |
download | SCons-ae1e7c742dcd1ed0b521640455794172fe275c65.zip SCons-ae1e7c742dcd1ed0b521640455794172fe275c65.tar.gz SCons-ae1e7c742dcd1ed0b521640455794172fe275c65.tar.bz2 |
Replace remaining os.path.walk() calls with os.walk().
Diffstat (limited to 'test/Parallel')
-rw-r--r-- | test/Parallel/duplicate-target.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/Parallel/duplicate-target.py b/test/Parallel/duplicate-target.py index a9d511e..efe20d9 100644 --- a/test/Parallel/duplicate-target.py +++ b/test/Parallel/duplicate-target.py @@ -56,16 +56,20 @@ test.write(['work', 'mytar.py'], """\ import sys import os.path -def visit(arg, dirname, fnames): - fnames.sort() - for fn in fnames: - p = os.path.join(dirname, fn) - if os.path.isfile(p): - arg.write(open(p, 'rb').read()) - fp = open(sys.argv[1], 'wb') + +def visit(dirname): + names = os.listdir(dirname) + names.sort() + for n in names: + p = os.path.join(dirname, n) + if os.path.isdir(p): + visit(p) + elif os.path.isfile(p): + fp.write(open(p, 'rb').read()) + for s in sys.argv[2:]: - os.path.walk(s, visit, fp) + visit(s) """) test.write(['work', 'SConstruct'], """\ |