diff options
author | Reid Barton <rwbarton@gmail.com> | 2017-02-23 13:44:17 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-02-23 17:26:44 -0500 |
commit | 48a967ccf75145b7ffb5bf70d447bc533d17ade4 (patch) | |
tree | fdac596c87c91f91fdc6f0a0efe135586b3c88fc /testsuite/driver/runtests.py | |
parent | 3cb9b52fba92a0799d0c21f4ea247493dd0b811b (diff) | |
download | haskell-48a967ccf75145b7ffb5bf70d447bc533d17ade4.tar.gz |
testsuite: Remove old python version tests
Test Plan: harbormaster
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3140
Diffstat (limited to 'testsuite/driver/runtests.py')
-rw-r--r-- | testsuite/driver/runtests.py | 42 |
1 files changed, 4 insertions, 38 deletions
diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py index 28b393a0f9..df85fa1d40 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: |