src/tests/pkg5unittest.py
branchs11u2-sru
changeset 3240 3661c0b9accd
parent 3192 13377dbd6773
--- 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):