Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/cdcdfabf2da5300128c75d41fdc9f6f6a850f3c4

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

commit cdcdfabf2da5300128c75d41fdc9f6f6a850f3c4
Author: Ian Lynagh <[email protected]>
Date:   Fri Apr 27 20:11:44 2012 +0100

    Testsuite driver tweak for Windows
    
    This handles the case where we redirect stdout/stderr to a file, but
    the command fails quickly and the file is not actually created.

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

 driver/testlib.py |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/driver/testlib.py b/driver/testlib.py
index fe727bf..77669e6 100644
--- a/driver/testlib.py
+++ b/driver/testlib.py
@@ -1466,9 +1466,15 @@ def dump_stderr( name ):
    print read_no_crs(qualify(name, 'run.stderr'))
 
 def read_no_crs(file):
-    h = open(file)
-    str = h.read()
-    h.close
+    str = ''
+    try:
+        h = open(file)
+        str = h.read()
+        h.close
+    except:
+        # On Windows, if the program fails very early, it seems the
+        # files stdout/stderr are redirected to may not get created
+        pass
     return re.sub('\r', '', str)
 
 def write_file(file, str):



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to