summaryrefslogtreecommitdiff
path: root/testsuite/driver
diff options
context:
space:
mode:
authorMateusz Lenik <mlen@mlen.pl>2014-10-30 11:50:41 -0500
committerAustin Seipp <austin@well-typed.com>2014-10-30 11:50:42 -0500
commitc6d4ae6f437fb041ea70f3d2b4f7f0d03ff797bf (patch)
treeb068ee6d1e5af74c2fc8c73965e5793974c541e5 /testsuite/driver
parent9de52406522dc43722f5ee06ba89a63da133099e (diff)
downloadhaskell-c6d4ae6f437fb041ea70f3d2b4f7f0d03ff797bf.tar.gz
Fix test driver python3 compatibility issues
Summary: Fixes python3 compatibility issues by replacing filter with a list comperhension and a potential issue with python2 when override_flags would be an empty list. Reviewers: austin, thomie Reviewed By: austin, thomie Subscribers: thomie, carter, simonmar, mlen Differential Revision: https://phabricator.haskell.org/D399 GHC Trac Issues: #9230
Diffstat (limited to 'testsuite/driver')
-rw-r--r--testsuite/driver/testlib.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 3093982336..87e37d5ce9 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -920,7 +920,7 @@ def run_command( name, way, cmd ):
def ghci_script_without_flag(flag):
def apply(name, way, script):
- overrides = filter(lambda f: f != flag, getTestOpts().compiler_always_flags)
+ overrides = [f for f in getTestOpts().compiler_always_flags if f != flag]
return ghci_script_override_default_flags(overrides)(name, way, script)
return apply
@@ -933,7 +933,7 @@ def ghci_script_override_default_flags(overrides):
def ghci_script( name, way, script, override_flags = None ):
# Use overriden default flags when given
- if override_flags:
+ if override_flags is not None:
default_flags = override_flags
else:
default_flags = getTestOpts().compiler_always_flags
@@ -973,14 +973,14 @@ def compile_fail_override_default_flags(overrides):
def compile_without_flag(flag):
def apply(name, way, extra_opts):
- overrides = filter(lambda f: f != flag, getTestOpts().compiler_always_flags)
+ overrides = [f for f in getTestOpts().compiler_always_flags if f != flag]
return compile_override_default_flags(overrides)(name, way, extra_opts)
return apply
def compile_fail_without_flag(flag):
def apply(name, way, extra_opts):
- overrides = filter(lambda f: f != flag, getTestOpts().compiler_always_flags)
+ overrides = [f for f in getTestOpts.compiler_always_flags if f != flag]
return compile_fail_override_default_flags(overrides)(name, way, extra_opts)
return apply
@@ -1225,7 +1225,7 @@ def simple_build( name, way, extra_hc_opts, should_fail, top_mod, link, addsuf,
else:
cmd_prefix = getTestOpts().compile_cmd_prefix + ' '
- if override_flags:
+ if override_flags is not None:
comp_flags = copy.copy(override_flags)
else:
comp_flags = copy.copy(getTestOpts().compiler_always_flags)