Verified Commit 5d57ecae authored by Juliana Oliveira's avatar Juliana Oliveira Committed by Mattia Rizzolo

{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.
parent f93fb4c1
......@@ -102,6 +102,10 @@ class Command(object, metaclass=abc.ABCMeta):
def stderr_content(self):
return self.stderr
def returncode(self):
return self._process.returncode
def stdout(self):
return self._process.stdout.splitlines(True)
......@@ -120,7 +120,8 @@ class ZipFile(File):
class MozillaZipCommandMixin(object):
def wait(self):
def returncode(self):
# zipinfo emits an error when reading Mozilla-optimized ZIPs,
# which is fine to ignore.
return 0
......@@ -86,7 +86,7 @@ def from_command(command):
end_nl = feeder(out_file)
returncode = command.wait()
returncode = command.returncode
if returncode not in (0, -signal.SIGTERM):
raise subprocess.CalledProcessError(
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment