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 <swarren@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Simon Glass <sjg@chromium.org> [on sandbox]
Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Tom Rini 2019-10-24 11:59:20 -04:00
parent 3c941e048c
commit fe1193e254
8 changed files with 64 additions and 73 deletions

View file

@ -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'))