--- a/src/tests/api/t_printengine.py Tue Jun 09 15:20:07 2015 -0700
+++ b/src/tests/api/t_printengine.py Wed Jul 16 06:51:23 2014 -0700
@@ -43,8 +43,10 @@
def __drain(masterf):
"""Drain data from masterf and discard until eof."""
while True:
- termdata = masterf.read(1024)
- if len(termdata) == 0:
+ chunksz = 1024
+ termdata = masterf.read(chunksz)
+ if len(termdata) < chunksz:
+ # assume we hit EOF
break
print >> sio, termdata
--- a/src/tests/api/t_progress.py Tue Jun 09 15:20:07 2015 -0700
+++ b/src/tests/api/t_progress.py Wed Jul 16 06:51:23 2014 -0700
@@ -336,8 +336,10 @@
def __t_pty_tracker(self, trackerclass, **kwargs):
def __drain(masterf):
while True:
- termdata = masterf.read(1024)
- if len(termdata) == 0:
+ chunksz = 1024
+ termdata = masterf.read(chunksz)
+ if len(termdata) < chunksz:
+ # assume we hit EOF
break
#
--- a/src/tests/pkg5unittest.py Tue Jun 09 15:20:07 2015 -0700
+++ b/src/tests/pkg5unittest.py Wed Jul 16 06:51:23 2014 -0700
@@ -366,11 +366,12 @@
def __drain(masterf, outlist):
# Use a list as a way to pass by reference
while True:
- termdata = masterf.read(1024)
- if len(termdata) == 0:
+ chunksz = 1024
+ termdata = masterf.read(chunksz)
+ outlist.append(termdata)
+ if len(termdata) < chunksz:
+ # assume we hit EOF
break
- else:
- outlist.append(termdata)
# This is the arg handling protocol from Popen
if isinstance(args, types.StringTypes):