From cbcd3ecf154d0cd5df8aa1540351bc0a74df6d5f Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Tue, 26 Jan 2021 12:35:03 +0000 Subject: [PATCH] tests: Remove Python 2.7 glue code Remove uses of six and from __future__ imports as they are no longer needed. Change-Id: I74b5250722abe1e202f31a9ec1d4cc04039df168 Signed-off-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39757 Reviewed-by: Jason Lowe-Power Maintainer: Bobby R. Bruce Tested-by: kokoro --- tests/configs/gpu-ruby.py | 2 -- tests/gem5/configs/base_config.py | 4 +--- tests/gem5/configs/checkpoint.py | 2 -- tests/gem5/configs/switcheroo.py | 2 -- tests/gem5/fixture.py | 3 ++- tests/gem5/fs/linux/arm/run.py | 2 -- tests/gem5/memory/test.py | 3 +-- tests/main.py | 1 - tests/run.py | 2 -- 9 files changed, 4 insertions(+), 17 deletions(-) diff --git a/tests/configs/gpu-ruby.py b/tests/configs/gpu-ruby.py index a463fe3b4..b561d0228 100644 --- a/tests/configs/gpu-ruby.py +++ b/tests/configs/gpu-ruby.py @@ -33,8 +33,6 @@ # Author: Brad Beckmann # -from __future__ import print_function - import m5 from m5.objects import * from m5.defines import buildEnv diff --git a/tests/gem5/configs/base_config.py b/tests/gem5/configs/base_config.py index 5623db8be..b18cecfdf 100644 --- a/tests/gem5/configs/base_config.py +++ b/tests/gem5/configs/base_config.py @@ -42,12 +42,10 @@ from common import FSConfig from common import Options from common.Caches import * from ruby import Ruby -from six import add_metaclass _have_kvm_support = 'BaseKvmCPU' in globals() -@add_metaclass(ABCMeta) -class BaseSystem(object): +class BaseSystem(object, metaclass=ABCMeta): """Base system builder. This class provides some basic functionality for creating an ARM diff --git a/tests/gem5/configs/checkpoint.py b/tests/gem5/configs/checkpoint.py index a652094dc..354509581 100644 --- a/tests/gem5/configs/checkpoint.py +++ b/tests/gem5/configs/checkpoint.py @@ -33,8 +33,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import print_function - from multiprocessing import Process import sys import os diff --git a/tests/gem5/configs/switcheroo.py b/tests/gem5/configs/switcheroo.py index cb47f9042..fb1db8132 100644 --- a/tests/gem5/configs/switcheroo.py +++ b/tests/gem5/configs/switcheroo.py @@ -33,8 +33,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import print_function - import m5 import _m5 from m5.objects import * diff --git a/tests/gem5/fixture.py b/tests/gem5/fixture.py index 467eb4303..5ffb2482a 100644 --- a/tests/gem5/fixture.py +++ b/tests/gem5/fixture.py @@ -44,7 +44,8 @@ import socket import threading import gzip -from six.moves import urllib +import urllib.error +import urllib.request from testlib.fixture import Fixture from testlib.configuration import config, constants diff --git a/tests/gem5/fs/linux/arm/run.py b/tests/gem5/fs/linux/arm/run.py index a0d782bcd..3dccebb8a 100644 --- a/tests/gem5/fs/linux/arm/run.py +++ b/tests/gem5/fs/linux/arm/run.py @@ -36,8 +36,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import print_function - import sys import os import os.path diff --git a/tests/gem5/memory/test.py b/tests/gem5/memory/test.py index 7b839f2fe..db20ab586 100644 --- a/tests/gem5/memory/test.py +++ b/tests/gem5/memory/test.py @@ -28,7 +28,6 @@ Test file for simple memory test TODO: Add stats checking ''' -import six from testlib import * @@ -50,7 +49,7 @@ simple_mem_params = [ for name, params in simple_mem_params: - args = ['--' + key + '=' + val for key,val in six.iteritems(params)] + args = ['--' + key + '=' + val for key,val in params.items()] gem5_verify_config( name='simple_mem_' + name, diff --git a/tests/main.py b/tests/main.py index 3287ef14c..39717f661 100755 --- a/tests/main.py +++ b/tests/main.py @@ -5,7 +5,6 @@ loaders. Discovers and runs all tests from a given root directory. ''' -from __future__ import print_function import sys import os diff --git a/tests/run.py b/tests/run.py index a8b612b9e..c3360acbd 100644 --- a/tests/run.py +++ b/tests/run.py @@ -36,8 +36,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import print_function - import os import sys import re -- 2.30.2