[pypy-commit] pypy stmgc-c7: Process truncated log files

arigo noreply at buildbot.pypy.org
Sun Jan 18 14:52:54 CET 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r75425:f7b0089c0975
Date: 2015-01-18 14:52 +0100
http://bitbucket.org/pypy/pypy/changeset/f7b0089c0975/

Log:	Process truncated log files

diff --git a/pypy/stm/print_stm_log.py b/pypy/stm/print_stm_log.py
--- a/pypy/stm/print_stm_log.py
+++ b/pypy/stm/print_stm_log.py
@@ -72,7 +72,7 @@
         result = []
         while True:
             packet = f.read(19)
-            if not packet: break
+            if len(packet) < 19: break
             sec, nsec, threadnum, otherthreadnum, event, len1, len2 = \
                   struct.unpack("IIIIBBB", packet)
             if event >= _STM_EVENT_N:


More information about the pypy-commit mailing list