[diffoscope] 07/10: comparators: zip: replaces .wait() override by .returncode

Juliana Oliveira jwnx-guest at moszumanska.debian.org
Mon Jan 29 03:43:23 CET 2018


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

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

commit 4859a2843551edb6e86c09bfb1a9efa3d3cf3b52
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 60d41ac..2028db6 100644
--- a/diffoscope/comparators/zip.py
+++ b/diffoscope/comparators/zip.py
@@ -120,10 +120,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