[commit: ghc] master: testsuite: Remove old python version tests (48a967c)

git at git.haskell.org git at git.haskell.org
Thu Feb 23 22:27:21 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/48a967ccf75145b7ffb5bf70d447bc533d17ade4/ghc

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

commit 48a967ccf75145b7ffb5bf70d447bc533d17ade4
Author: Reid Barton <rwbarton at gmail.com>
Date:   Thu Feb 23 13:44:17 2017 -0500

    testsuite: Remove old python version tests
    
    Test Plan: harbormaster
    
    Reviewers: austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D3140


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

48a967ccf75145b7ffb5bf70d447bc533d17ade4
 testsuite/driver/runtests.py | 42 ++++--------------------------------------
 1 file changed, 4 insertions(+), 38 deletions(-)

diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py
index 28b393a..df85fa1 100644
--- a/testsuite/driver/runtests.py
+++ b/testsuite/driver/runtests.py
@@ -11,7 +11,6 @@ import sys
 import os
 import string
 import getopt
-import platform
 import shutil
 import tempfile
 import time
@@ -25,8 +24,6 @@ import re
 # So we import it here first, so that the testsuite doesn't appear to fail.
 import subprocess
 
-PYTHON3 = sys.version_info >= (3, 0)
-
 from testutil import *
 from testglobals import *
 
@@ -120,29 +117,6 @@ for opt,arg in opts:
         config.verbose = int(arg)
 
 
-if config.use_threads == 1:
-    # Trac #1558 says threads don't work in python 2.4.4, but do
-    # in 2.5.2. Probably >= 2.5 is sufficient, but let's be
-    # conservative here.
-    # Some versions of python have things like '1c1' for some of
-    # these components (see trac #3091), but int() chokes on the
-    # 'c1', so we drop it.
-    (maj, min, pat) = platform.python_version_tuple()
-    # We wrap maj, min, and pat in str() to work around a bug in python
-    # 2.6.1
-    maj = int(re.sub('[^0-9].*', '', str(maj)))
-    min = int(re.sub('[^0-9].*', '', str(min)))
-    pat = int(re.sub('[^0-9].*', '', str(pat)))
-    if (maj, min) < (2, 6):
-        print("Python < 2.6 is not supported")
-        sys.exit(1)
-    # We also need to disable threads for python 2.7.2, because of
-    # this bug: http://bugs.python.org/issue13817
-    elif (maj, min, pat) == (2, 7, 2):
-        print("Warning: Ignoring request to use threads as python version is 2.7.2")
-        print("See http://bugs.python.org/issue13817 for details.")
-        config.use_threads = 0
-
 config.cygwin = False
 config.msys = False
 
@@ -267,12 +241,8 @@ t.start_time = time.localtime()
 print('Beginning test run at', time.strftime("%c %Z",t.start_time))
 
 sys.stdout.flush()
-if PYTHON3:
-    # in Python 3, we output text, which cannot be unbuffered
-    sys.stdout = os.fdopen(sys.__stdout__.fileno(), "w")
-else:
-    # set stdout to unbuffered (is this the best way to do it?)
-    sys.stdout = os.fdopen(sys.__stdout__.fileno(), "w", 0)
+# we output text, which cannot be unbuffered
+sys.stdout = os.fdopen(sys.__stdout__.fileno(), "w")
 
 if config.local:
     tempdir = ''
@@ -301,12 +271,8 @@ for file in t_files:
     if_verbose(2, '====> Scanning %s' % file)
     newTestDir(tempdir, os.path.dirname(file))
     try:
-        if PYTHON3:
-            with io.open(file, encoding='utf8') as f:
-                src = f.read()
-        else:
-            with open(file) as f:
-                src = f.read()
+        with io.open(file, encoding='utf8') as f:
+            src = f.read()
 
         exec(src)
     except Exception as e:



More information about the ghc-commits mailing list