[diffoscope] 02/03: Also handle end of input in DiffParser.read_headers

Jérémy Bobbio lunar at moszumanska.debian.org
Fri Dec 18 16:49:16 CET 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository diffoscope.

commit 727d878361196de867dcec6448b1a1e77fb1931a
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Fri Dec 18 15:42:09 2015 +0000

    Also handle end of input in DiffParser.read_headers
---
 diffoscope/difference.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/diffoscope/difference.py b/diffoscope/difference.py
index d418d4e..4a915dc 100644
--- a/diffoscope/difference.py
+++ b/diffoscope/difference.py
@@ -64,7 +64,9 @@ class DiffParser(object):
 
     def read_headers(self, line):
         found = DiffParser.RANGE_RE.match(line)
-        if line.startswith('---'):
+        if not line:
+            return None
+        elif line.startswith('---'):
             return self.read_headers
         elif line.startswith('+++'):
             return self.read_headers

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list