[diffoscope] 04/05: diffoscope.diff: Use %r over %s & repr(line)

Chris Lamb chris at chris-lamb.co.uk
Thu Feb 2 03:51:39 CET 2017


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

lamby pushed a commit to branch master
in repository diffoscope.

commit 5fecba726c55698dd6627a2ac23bbe13d709bfed
Author: Chris Lamb <lamby at debian.org>
Date:   Thu Feb 2 15:34:04 2017 +1300

    diffoscope.diff: Use %r over %s & repr(line)
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 diffoscope/diff.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/diffoscope/diff.py b/diffoscope/diff.py
index 011916a..134bfe3 100644
--- a/diffoscope/diff.py
+++ b/diffoscope/diff.py
@@ -84,7 +84,7 @@ class DiffParser(object):
         found = DiffParser.RANGE_RE.match(line)
 
         if not found:
-            raise ValueError('Unable to parse diff headers: %s' % repr(line))
+            raise ValueError('Unable to parse diff headers: %r' % line)
 
         self._diff.write(line)
         if found.group('len1'):
@@ -121,7 +121,7 @@ class DiffParser(object):
         elif self._remaining_hunk_lines == 0:
             return self.read_headers(line)
         else:
-            raise ValueError('Unable to parse diff hunk: %s' % repr(line))
+            raise ValueError('Unable to parse diff hunk: %r' % line)
 
         self._diff.write(line)
 

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


More information about the diffoscope mailing list