[Reproducible-commits] [diffoscope] 01/07: Properly call the get_content method when looking for PPU magic number

Jérémy Bobbio lunar at moszumanska.debian.org
Thu Nov 12 14:34:04 UTC 2015


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

lunar pushed a commit to branch master
in repository diffoscope.

commit 9912b82cc71cf11c206064bfb8598a13efd44a8f
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Wed Nov 11 13:29:46 2015 +0100

    Properly call the get_content method when looking for PPU magic number
---
 diffoscope/comparators/ppu.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/diffoscope/comparators/ppu.py b/diffoscope/comparators/ppu.py
index 5fb8955..1da596e 100644
--- a/diffoscope/comparators/ppu.py
+++ b/diffoscope/comparators/ppu.py
@@ -44,14 +44,10 @@ class DotPpuFile(File):
     def recognizes(file):
         if not DotPpuFile.RE_FILE_EXTENSION.search(file.name):
             return False
-        if file.path != None:
+        with file.get_content():
             with open(file.path, 'rb') as f:
                 if re.match(rb'^PPU[0-9]+', f.read(32)):
                     return True
-        else:
-            with open(file.name, 'rb') as f:
-                if re.match(rb'^PPU[0-9]+', f.read(32)):
-                    return True
         return False
 
     @needs_content

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



More information about the Reproducible-commits mailing list