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>
diff --git a/test/py/conftest.py b/test/py/conftest.py
index 30c898b..5c19af1 100644
--- a/test/py/conftest.py
+++ b/test/py/conftest.py
@@ -19,13 +19,10 @@
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 @@
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'))