[diffoscope] 02/05: {command, zip, feeders}: replaces .wait by new .returncode property
Juliana Oliveira
jwnx-guest at moszumanska.debian.org
Sun Feb 11 01:32:49 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 1077a559d97d4ecf7a807a9758c4c7b013bd1780
Author: Juliana Oliveira <juliana.orod at gmail.com>
Date: Sat Feb 10 17:26:45 2018 -0200
{command, zip, feeders}: replaces .wait by new .returncode property
Since wait() now only returns its process returncode, there is no need
to keep it. This patch adds a returncode property to Command and
replaces .wait when catching exit codes.
---
diffoscope/comparators/utils/command.py | 4 ++++
diffoscope/comparators/zip.py | 3 ++-
diffoscope/feeders.py | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/diffoscope/comparators/utils/command.py b/diffoscope/comparators/utils/command.py
index 0a1634c..a1ae4f9 100644
--- a/diffoscope/comparators/utils/command.py
+++ b/diffoscope/comparators/utils/command.py
@@ -103,5 +103,9 @@ class Command(object, metaclass=abc.ABCMeta):
return self.stderr
@property
+ def returncode(self):
+ return self._process.returncode
+
+ @property
def stdout(self):
return self._process.stdout.splitlines(True)
diff --git a/diffoscope/comparators/zip.py b/diffoscope/comparators/zip.py
index e626138..a3d640c 100644
--- a/diffoscope/comparators/zip.py
+++ b/diffoscope/comparators/zip.py
@@ -120,7 +120,8 @@ 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.
return 0
diff --git a/diffoscope/feeders.py b/diffoscope/feeders.py
index f064214..8522584 100644
--- a/diffoscope/feeders.py
+++ b/diffoscope/feeders.py
@@ -86,7 +86,7 @@ def from_command(command):
command.filter,
)
end_nl = feeder(out_file)
- returncode = command.wait()
+ returncode = command.returncode
if returncode not in (0, -signal.SIGTERM):
raise subprocess.CalledProcessError(
returncode,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list