From b189a5a3fb33caf8e23f6cdb329901f0675946ad Mon Sep 17 00:00:00 2001
From: Thomas Miedema <thomasmiedema@gmail.com>
Date: Mon, 23 Mar 2015 13:56:22 +0100
Subject: [PATCH] Make testsuite driver Python 2.6 compatible again

Another bug in the #10164 series. Only Python 2.7 and up allow you to
omit the positional argument specifiers in format strings.

Test Plan: this fixes the Solaris builders

Reviewed By: kgardas

Differential Revision: https://phabricator.haskell.org/D750

GHC Trac Issues: #10164

(cherry picked from commit 0f03a843e7e740218f3ce3853f80de99b0ed6236)
---
 testsuite/driver/testlib.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 29ceedb159d2..af1dcdf6755a 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -1294,11 +1294,11 @@ def simple_run( name, way, prog, args ):
         stdin_comes_from = ' <' + use_stdin
 
     if opts.combined_output:
-        redirection        = ' > {} 2>&1'.format(run_stdout)
-        redirection_append = ' >> {} 2>&1'.format(run_stdout)
+        redirection        = ' > {0} 2>&1'.format(run_stdout)
+        redirection_append = ' >> {0} 2>&1'.format(run_stdout)
     else:
-        redirection        = ' > {} 2> {}'.format(run_stdout, run_stderr)
-        redirection_append = ' >> {} 2>> {}'.format(run_stdout, run_stderr)
+        redirection        = ' > {0} 2> {1}'.format(run_stdout, run_stderr)
+        redirection_append = ' >> {0} 2>> {1}'.format(run_stdout, run_stderr)
 
     cmd = prog + ' ' + args + ' '  \
         + my_rts_flags + ' '       \
@@ -1406,11 +1406,11 @@ def interpreter_run( name, way, extra_hc_opts, compile_only, top_mod ):
                      config.way_flags(name)[way])
 
     if getTestOpts().combined_output:
-        redirection        = ' > {} 2>&1'.format(outname)
-        redirection_append = ' >> {} 2>&1'.format(outname)
+        redirection        = ' > {0} 2>&1'.format(outname)
+        redirection_append = ' >> {0} 2>&1'.format(outname)
     else:
-        redirection        = ' > {} 2> {}'.format(outname, errname)
-        redirection_append = ' >> {} 2>> {}'.format(outname, errname)
+        redirection        = ' > {0} 2> {1}'.format(outname, errname)
+        redirection_append = ' >> {0} 2>> {1}'.format(outname, errname)
 
     cmd = ('{{compiler}} {srcname} {flags} {extra_hc_opts} '
            '< {scriptname} {redirection}'
-- 
GitLab