From fe1193e254faccc4e6629f1cfbc99d5ceb34428a Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Thu, 24 Oct 2019 11:59:20 -0400 Subject: test/py: Automated conversion to Python 3 Use the 2to3 tool to perform numerous automatic conversions from Python 2 syntax to Python 3. Also fix whitespace problems that Python 3 catches that Python 2 did not. Reviewed-by: Stephen Warren Reviewed-by: Simon Glass Tested-by: Stephen Warren Tested-by: Simon Glass [on sandbox] Signed-off-by: Tom Rini --- test/py/conftest.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'test/py/conftest.py') diff --git a/test/py/conftest.py b/test/py/conftest.py index 30c898b40a0..5c19af1d503 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -19,13 +19,10 @@ import os.path import pytest from _pytest.runner import runtestprotocol import re -import StringIO +import io import sys -try: - import configparser -except: - import ConfigParser as configparser +import configparser # Globals: The HTML log file, and the connection to the U-Boot console. log = None @@ -169,7 +166,7 @@ def pytest_configure(config): with open(dot_config, 'rt') as f: ini_str = '[root]\n' + f.read() - ini_sio = StringIO.StringIO(ini_str) + ini_sio = io.StringIO(ini_str) parser = configparser.RawConfigParser() parser.readfp(ini_sio) ubconfig.buildconfig.update(parser.items('root')) -- cgit v1.2.3