diff options
author | Tom Rini <trini@konsulko.com> | 2019-10-24 18:59:21 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-10-31 00:48:47 +0300 |
commit | fd31fc172c626bdac2afd8af9f8482bfc21a5501 (patch) | |
tree | fefb916d5990dba2ded574cac03e115fc23199cd /test/py/u_boot_spawn.py | |
parent | fe1193e254faccc4e6629f1cfbc99d5ceb34428a (diff) | |
download | u-boot-fd31fc172c626bdac2afd8af9f8482bfc21a5501.tar.xz |
test/py: Manual python3 fixes
- Modern pytest is more visible in telling us about parameters that we
had not described, so describe a few more.
- ConfigParser.readfp(...) is now configparser.read_file(...)
- As part of the "strings vs bytes" conversions in Python 3, we use the
default encoding/decoding of utf-8 but in some places tell Python to
replace problematic conversions rather than throw a fatal error.
- Fix a typo noticed while doing the above ("tot he" -> "to the").
- As suggested by Stephen, re-alphabetize the import list
- Per Heinrich, replace how we write contents in test_fit.py
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>
Diffstat (limited to 'test/py/u_boot_spawn.py')
-rw-r--r-- | test/py/u_boot_spawn.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/py/u_boot_spawn.py b/test/py/u_boot_spawn.py index b011a3e3da..4f898cdefe 100644 --- a/test/py/u_boot_spawn.py +++ b/test/py/u_boot_spawn.py @@ -113,7 +113,7 @@ class Spawn(object): Nothing. """ - os.write(self.fd, data) + os.write(self.fd, data.encode(errors='replace')) def expect(self, patterns): """Wait for the sub-process to emit specific data. @@ -171,7 +171,7 @@ class Spawn(object): events = self.poll.poll(poll_maxwait) if not events: raise Timeout() - c = os.read(self.fd, 1024) + c = os.read(self.fd, 1024).decode(errors='replace') if not c: raise EOFError() if self.logfile_read: |