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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/2f52323e02aaac375e7a19a53a188858ccee1d80

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

commit 2f52323e02aaac375e7a19a53a188858ccee1d80
Author: Ian Lynagh <[email protected]>
Date:   Sat Sep 24 15:54:09 2011 +0100

    Don't use "with lock" syntax in the driver
    
    Older versions of python, including that on the Windows nightly builder,
    throw "SyntaxError: invalid syntax".

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

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

diff --git a/driver/testlib.py b/driver/testlib.py
index dcf9752..3b3644c 100644
--- a/driver/testlib.py
+++ b/driver/testlib.py
@@ -1623,8 +1623,15 @@ def mkPath(curdir, path):
 
 def addTestFilesWritten(name, fn):
     if config.use_threads:
-        with t.lockFilesWritten:
+        # We would use
+        #     with t.lockFilesWritten:
+        #         addTestFilesWrittenHelper(name, fn)
+        # but old versions of python fail with "SyntaxError: invalid syntax"
+        t.lockFilesWritten.acquire()
+        try:
             addTestFilesWrittenHelper(name, fn)
+        finally:
+            t.lockFilesWritten.release()
     else:
         addTestFilesWrittenHelper(name, fn)
 



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

Reply via email to