summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krz.gogolewski@gmail.com>2014-10-04 19:22:04 +0200
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>2014-10-04 19:27:59 +0200
commit8d95768c80baf47526d08b89e3beba24233fb448 (patch)
tree8231859495367e9c74f59acadf16698f0af9915b
parente8dac6dc60beea863c3a5daded68f5157ab546fb (diff)
downloadhaskell-8d95768c80baf47526d08b89e3beba24233fb448.tar.gz
Testsuite driver: Fix findTFiles for Python 3
Previous version broke Windows build. I'm unhappy about this code, but at least it no longer appends lists in O(n^2)...
-rw-r--r--testsuite/driver/testlib.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index e3562f7c54..397ff3be95 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -2041,14 +2041,17 @@ def pretest_cleanup(name):
# not interested in the return code
# -----------------------------------------------------------------------------
-# Return a list of all the files ending in '.T' below the directory dir.
+# Return a list of all the files ending in '.T' below directories roots.
def findTFiles(roots):
- return concat(map(findTFiles_,roots))
+ # It would be better to use os.walk, but that
+ # gives backslashes on Windows, which trip the
+ # testsuite later :-(
+ return [filename for root in roots for filename in findTFiles_(root)]
def findTFiles_(path):
if os.path.isdir(path):
- paths = map(lambda x, p=path: p + '/' + x, os.listdir(path))
+ paths = [path + '/' + x for x in os.listdir(path)]
return findTFiles(paths)
elif path[-2:] == '.T':
return [path]