[diffoscope] 02/04: comparators: zip: replaces .wait() override by .returncode

Juliana Oliveira jwnx-guest at moszumanska.debian.org
Thu Jan 25 17:15:11 CET 2018


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

jwnx-guest pushed a commit to branch jwnx_parallel_diffoscope
in repository diffoscope.

commit 7e436f37474a724311dfc67207bd498bbf8af7b4
Author: Juliana Oliveira <juliana.orod at gmail.com>
Date:   Wed Jan 24 07:09:41 2018 -0200

    comparators: zip: replaces .wait() override by .returncode
    
    When using Popen, a command returncode was returned by Command.wait()
    function. It is known that zipinfo returns error code 2 for Mozzip
    files, so there was a .wait() function override inside MozillaZipCommandMixin
    to always return code 0, masking code 2 returned by the original
    command.
    
    Since we replaced subprocess.Popen by subprocess.run, returncode is
    now caught by Command.returncode instead of Command.wait(). This patch
    replaces the original .wait() override inside MozillaZipCommandMixin
    by a returncode override in order to keep ignoring zipinfo warnings.
    
    Signed-off-by: Juliana Oliveira <juliana.orod at gmail.com>
---
 diffoscope/comparators/zip.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/diffoscope/comparators/zip.py b/diffoscope/comparators/zip.py
index 58a63ce..72db292 100644
--- a/diffoscope/comparators/zip.py
+++ b/diffoscope/comparators/zip.py
@@ -121,10 +121,10 @@ class ZipFile(File):
 
 
 class MozillaZipCommandMixin(object):
-    def wait(self):
+    @property
+    def returncode(self):
         # zipinfo emits an error when reading Mozilla-optimized ZIPs,
         # which is fine to ignore.
-        super(Zipinfo, self).wait()
         return 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