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

On branch  : master

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

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

commit 2c6023219c0338c3de6268aedd9c3be217c53769
Author: Ian Lynagh <[email protected]>
Date:   Tue May 1 15:10:30 2012 +0100

    Change how we detect whether the terminal is cygwin or msys
    
    sys.platform now always returns 'win32' for me.

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

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

diff --git a/driver/runtests.py b/driver/runtests.py
index 301344e..0779134 100644
--- a/driver/runtests.py
+++ b/driver/runtests.py
@@ -18,11 +18,6 @@ from testglobals import *
 # value.
 os.environ['TERM'] = 'vt100'
 
-if sys.platform == "cygwin":
-    cygwin = True
-else:
-    cygwin = False
-
 global config
 config = getConfig() # get it from testglobals
 
@@ -115,15 +110,20 @@ if config.use_threads == 1:
 config.cygwin = False
 config.msys = False
 if windows:
-    if cygwin:
+    h = os.popen('uname -s', 'r')
+    v = h.read()
+    h.close()
+    if v.startswith("CYGWIN"):
         config.cygwin = True
-    else:
+    elif v.startswith("MINGW32"):
         config.msys = True
+    else:
+        raise Exception("Can't detect Windows terminal type")
 
 # Try to use UTF8
 if windows:
     import ctypes
-    if cygwin:
+    if config.cygwin:
         # Is this actually right? Which calling convention does it use?
         # As of the time of writing, ctypes.windll doesn't exist in the
         # cygwin python, anyway.
@@ -182,7 +182,7 @@ if windows or darwin:
                 path = re.sub('^"(.*)"$', '\\1', path)
                 path = re.sub('\\\\(.)', '\\1', path)
             if windows:
-                if cygwin:
+                if config.cygwin:
                     # On cygwin we can't put "c:\foo" in $PATH, as : is a
                     # field separator. So convert to /cygdrive/c/foo instead.
                     # Other pythons use ; as the separator, so no problem.



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

Reply via email to