Commits

geertj  committed 887f4b5

Fix issue #3: logging of read data missing

  • Participants
  • Parent commits 35c3068

Comments (0)

Files changed (1)

File lib/winpexpect.py

         elif status == 'error':
             self._set_eof(handle)
             raise OSError, data
-        return self.chunk_buffer.read(size)
+        buf = self.chunk_buffer.read(size)
+        if self.logfile is not None:
+            self.logfile.write(buf)
+            self.logfile.flush()
+        if self.logfile_read is not None:
+            self.logfile_read.write(buf)
+            self.logfile_read.flush()
+        return buf