Message ID | 20190208225110.9289-1-masashi.honma@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [v2,1/4] tests: Change handling of reading non blocked empty stream for python3 | expand |
Thanks, all four patches applied.
On 2019/02/11 21:51, Jouni Malinen wrote:
> Thanks, all four patches applied.
This is the last patch of my python3 compatibility modification.
Thank you again for Jouni and Johannes!
Masashi Honma.
On Tue, 2019-02-12 at 09:37 +0900, Masashi Honma wrote: > On 2019/02/11 21:51, Jouni Malinen wrote: > > Thanks, all four patches applied. > > This is the last patch of my python3 compatibility modification. > Thank you again for Jouni and Johannes! No no, thank you! Are you going to send a patch also to switch the default to python3? johannes
On 2019/02/12 17:01, Johannes Berg wrote: > No no, thank you! > > Are you going to send a patch also to switch the default to python3? I will send the patch as RFC. Masashi Honma.
diff --git a/tests/hwsim/vm/parallel-vm.py b/tests/hwsim/vm/parallel-vm.py index cf7f8df65..e7b51d203 100755 --- a/tests/hwsim/vm/parallel-vm.py +++ b/tests/hwsim/vm/parallel-vm.py @@ -91,6 +91,8 @@ def vm_read_stdout(vm, i): ready = False try: out = vm['proc'].stdout.read() + if out == None: + return False except: return False logger.debug("VM[%d] stdout.read[%s]" % (i, out)) @@ -192,8 +194,9 @@ def show_progress(scr): first_running = True try: err = vm[i]['proc'].stderr.read() - vm[i]['err'] += err - logger.debug("VM[%d] stderr.read[%s]" % (i, err)) + if err != None: + vm[i]['err'] += err + logger.debug("VM[%d] stderr.read[%s]" % (i, err)) except: pass @@ -246,8 +249,9 @@ def show_progress(scr): running = True try: err = vm[i]['proc'].stderr.read() - vm[i]['err'] += err - logger.debug("VM[%d] stderr.read[%s]" % (i, err)) + if err != None: + vm[i]['err'] += err + logger.debug("VM[%d] stderr.read[%s]" % (i, err)) except: pass
The result of reading non blocked empty stream is different between python2 and 3. The python2 sends "[Errno 11] Resource temporarily unavailable" exception. The python3 could read "None" without exception. So separate processing. Signed-off-by: Masashi Honma <masashi.honma@gmail.com> --- tests/hwsim/vm/parallel-vm.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)