[commit: ghc] wip/python3: Use list comprehensions in config/ghc for Python 3 compatibility (3e6e981)

git at git.haskell.org git at git.haskell.org
Sat Sep 20 23:21:04 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/python3
Link       : http://ghc.haskell.org/trac/ghc/changeset/3e6e9813c0b3935a4f3cd1a34d6e1feef979c179/ghc

>---------------------------------------------------------------

commit 3e6e9813c0b3935a4f3cd1a34d6e1feef979c179
Author: Krzysztof Gogolewski <krz.gogolewski at gmail.com>
Date:   Sat Sep 20 18:37:04 2014 +0200

    Use list comprehensions in config/ghc for Python 3 compatibility


>---------------------------------------------------------------

3e6e9813c0b3935a4f3cd1a34d6e1feef979c179
 testsuite/config/ghc | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/testsuite/config/ghc b/testsuite/config/ghc
index 031d955..84b89d4 100644
--- a/testsuite/config/ghc
+++ b/testsuite/config/ghc
@@ -148,21 +148,17 @@ config.way_rts_flags = {
 # Useful classes of ways that can be used with only_ways() and
 # expect_broken_for().
 
-prof_ways = map (lambda x: x[0], \
-                 filter(lambda x: '-prof' in x[1], \
-                        config.way_flags('dummy_name').items()))
+prof_ways     = [x[0] for x in config.way_flags('dummy_name').items()
+                      if '-prof' in x[1]]
 
-threaded_ways = map (lambda x: x[0], \
-                 filter(lambda x: '-threaded' in x[1] or 'ghci' == x[0], \
-                        config.way_flags('dummy_name').items()))
+threaded_ways = [x[0] for x in config.way_flags('dummy_name').items()
+                      if '-threaded' in x[1] or 'ghci' == x[0]]
 
-opt_ways = map (lambda x: x[0], \
-                 filter(lambda x: '-O' in x[1], \
-                        config.way_flags('dummy_name').items()))
+opt_ways      = [x[0] for x in config.way_flags('dummy_name').items()
+                      if '-O' in x[1]]
 
-llvm_ways = map (lambda x: x[0], \
-                 filter(lambda x: '-fllvm' in x[1], \
-                        config.way_flags('dummy_name').items()))
+llvm_ways     = [x[0] for x in config.way_flags('dummy_name').items()
+                      if '-fflvm' in x[1]]
 
 def get_compiler_info():
 # This should really not go through the shell
@@ -192,7 +188,7 @@ def get_compiler_info():
 
     if re.match(".*_p(_.*|$)", rtsInfoDict["RTS way"]):
         config.compiler_profiled = True
-        config.run_ways = filter(lambda x: x != 'ghci', config.run_ways)
+        config.run_ways = [x for x in config.run_ways if x != 'ghci']
     else:
         config.compiler_profiled = False
 



More information about the ghc-commits mailing list