[diffoscope] 03/04: Rework parsing for next commit

Chris Lamb chris at chris-lamb.co.uk
Wed Jan 24 03:45:02 CET 2018


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

lamby pushed a commit to branch master
in repository diffoscope.

commit ee86038d9b20a9fc74f18ee55c689fc4ced28336
Author: Chris Lamb <lamby at debian.org>
Date:   Wed Jan 24 13:44:09 2018 +1100

    Rework parsing for next commit
    
    Gbp-Dch: ignore
---
 diffoscope/comparators/json.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/diffoscope/comparators/json.py b/diffoscope/comparators/json.py
index 00edafc..d942aa7 100644
--- a/diffoscope/comparators/json.py
+++ b/diffoscope/comparators/json.py
@@ -35,7 +35,8 @@ class JSONFile(File):
                 for x in ('ASCII text', 'UTF-8 Unicode text'),
             )
             if is_text and not file.name.endswith('.json'):
-                if '{' not in f.read(10):
+                buf = f.read(10)
+                if not any(x in buf for x in '{'):
                     return False
                 f.seek(0)
 

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


More information about the diffoscope mailing list