tests,python: Upgrading testlib to function with Python2
Change-Id: I9926b1507e9069ae8564c31bdd377b2b916462a2 Issue-on: https://gem5.atlassian.net/browse/GEM5-395 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29088 Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -34,7 +34,6 @@ from collections import MutableSet, OrderedDict
|
||||
import difflib
|
||||
import errno
|
||||
import os
|
||||
import Queue
|
||||
import re
|
||||
import shutil
|
||||
import stat
|
||||
@@ -44,6 +43,8 @@ import threading
|
||||
import time
|
||||
import traceback
|
||||
|
||||
from six.moves import queue as Queue
|
||||
|
||||
#TODO Tear out duplicate logic from the sandbox IOManager
|
||||
def log_call(logger, command, *popenargs, **kwargs):
|
||||
'''
|
||||
@@ -80,7 +81,8 @@ def log_call(logger, command, *popenargs, **kwargs):
|
||||
|
||||
def log_output(log_callback, pipe, redirects=tuple()):
|
||||
# Read iteractively, don't allow input to fill the pipe.
|
||||
for line in iter(pipe.readline, ''):
|
||||
for line in iter(pipe.readline, b''):
|
||||
line = line.decode("utf-8")
|
||||
for r in redirects:
|
||||
r.write(line)
|
||||
log_callback(line.rstrip())
|
||||
|
||||
Reference in New Issue
Block a user