From b78e5bd771f0d5a81692bc95f76929b092edf2f6 Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Tue, 27 Oct 2020 20:33:53 +0100 Subject: testing: remove __future__ and Python2 references Change-Id: I80079d8a0956e3cc9b27ceb5b5ea2cfc6c9c9449 Reviewed-by: Christian Tismer Reviewed-by: Friedemann Kleint --- testing/__init__.py | 2 -- testing/blacklist.py | 2 -- testing/buildlog.py | 2 -- testing/command.py | 2 -- testing/helper.py | 14 ++------------ testing/parser.py | 2 -- testing/runner.py | 6 ++---- testing/wheel_tester.py | 3 +-- 8 files changed, 5 insertions(+), 28 deletions(-) (limited to 'testing') diff --git a/testing/__init__.py b/testing/__init__.py index 03c590604..c97f32187 100644 --- a/testing/__init__.py +++ b/testing/__init__.py @@ -37,8 +37,6 @@ ## ############################################################################# -from __future__ import print_function - """ testing/__init__.py diff --git a/testing/blacklist.py b/testing/blacklist.py index f82f2b5e7..48ace7af7 100644 --- a/testing/blacklist.py +++ b/testing/blacklist.py @@ -37,8 +37,6 @@ ## ############################################################################# -from __future__ import print_function - """ testing/blacklist.py diff --git a/testing/buildlog.py b/testing/buildlog.py index 216282b4c..fbc112d16 100644 --- a/testing/buildlog.py +++ b/testing/buildlog.py @@ -37,8 +37,6 @@ ## ############################################################################# -from __future__ import print_function - """ testing/buildlog.py diff --git a/testing/command.py b/testing/command.py index 819fee8ce..f58bb7d81 100644 --- a/testing/command.py +++ b/testing/command.py @@ -37,8 +37,6 @@ ## ############################################################################# -from __future__ import print_function - """ testrunner ========== diff --git a/testing/helper.py b/testing/helper.py index 88da48c6e..d192cf061 100644 --- a/testing/helper.py +++ b/testing/helper.py @@ -37,8 +37,6 @@ ## ############################################################################# -from __future__ import print_function - """ testing/helper.py @@ -49,17 +47,9 @@ import os import sys from collections import namedtuple -PY3 = sys.version_info[0] == 3 # from the six module from subprocess import PIPE -if PY3: - from subprocess import TimeoutExpired - from io import StringIO -else: - class SubprocessError(Exception): pass - # this is a fake, just to keep the source compatible. - # timeout support is in python 3.3 and above. - class TimeoutExpired(SubprocessError): pass - from StringIO import StringIO +from subprocess import TimeoutExpired +from io import StringIO script_dir = os.path.dirname(os.path.dirname(__file__)) diff --git a/testing/parser.py b/testing/parser.py index 1d5c34680..511facfed 100644 --- a/testing/parser.py +++ b/testing/parser.py @@ -37,8 +37,6 @@ ## ############################################################################# -from __future__ import print_function - import os import re from collections import namedtuple diff --git a/testing/runner.py b/testing/runner.py index 83b7b08e6..9b1f88b8f 100644 --- a/testing/runner.py +++ b/testing/runner.py @@ -37,8 +37,6 @@ ## ############################################################################# -from __future__ import print_function - import os import sys import re @@ -49,7 +47,7 @@ from collections import namedtuple from textwrap import dedent from .buildlog import builds -from .helper import decorate, PY3, TimeoutExpired +from .helper import decorate, TimeoutExpired # Get the dir path to the utils module try: @@ -211,7 +209,7 @@ class TestRunner(object): stdin=ctest_process.stdout) try: comm = tee_process.communicate - output = (comm(timeout=timeout) if PY3 else comm())[0] + output = (comm(timeout=timeout) except (TimeoutExpired, KeyboardInterrupt): print() print("aborted, partial result") diff --git a/testing/wheel_tester.py b/testing/wheel_tester.py index 9f4c3ab6c..4339d7e95 100644 --- a/testing/wheel_tester.py +++ b/testing/wheel_tester.py @@ -51,7 +51,6 @@ looked up in your PATH. Make sure that some generated wheels already exist in the dist/ directory (e.g. setup.py bdist_wheel was already executed). """ -from __future__ import print_function, absolute_import from argparse import ArgumentParser, RawTextHelpFormatter import os, sys @@ -274,7 +273,7 @@ def execute_script(script_path): def prepare_build_folder(src_path, build_folder_name): build_path = os.path.join(src_path, build_folder_name) - # The script can be called for both Python 2 and Python 3 wheels, so + # The script can be called for Python 3 wheels, so # preparing a build folder should clean any previous existing build. if os.path.exists(build_path): log.info("Removing {}".format(build_path)) -- cgit v1.2.3