mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 23:51:08 +00:00
Replace simple Popen() calls with check_output()
This commit is contained in:
parent
2d3765522e
commit
23c7d67425
@ -34,8 +34,8 @@ class Builder(object):
|
||||
def __init__(self, name):
|
||||
self.name = name
|
||||
cmd = ["dpkg-architecture", "-qDEB_BUILD_ARCH_CPU"]
|
||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, encoding='utf-8')
|
||||
self.architecture = process.communicate()[0].strip()
|
||||
self.architecture = subprocess.check_output(
|
||||
cmd, encoding='utf-8').strip()
|
||||
|
||||
def _build_failure(self, returncode, dsc_file):
|
||||
if returncode != 0:
|
||||
|
@ -71,8 +71,7 @@ class Patch(object):
|
||||
patch_f.close()
|
||||
|
||||
cmd = ["diffstat", "-l", "-p0", self._full_path]
|
||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, encoding='utf-8')
|
||||
changed_files = process.communicate()[0]
|
||||
changed_files = subprocess.check_output(cmd, encoding='utf-8')
|
||||
self._changed_files = [f for f in changed_files.split("\n") if f != ""]
|
||||
|
||||
def get_strip_level(self):
|
||||
|
@ -327,8 +327,7 @@ class SourcePackage(object):
|
||||
if not Logger.verbose:
|
||||
cmd.insert(1, "-q")
|
||||
Logger.command(cmd + [">", self._debdiff_filename])
|
||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, encoding='utf-8')
|
||||
debdiff = process.communicate()[0]
|
||||
debdiff = subprocess.check_output(cmd, encoding='utf-8')
|
||||
|
||||
# write debdiff file
|
||||
debdiff_file = open(self._debdiff_filename, "w")
|
||||
@ -421,8 +420,7 @@ class SourcePackage(object):
|
||||
self._package + "_" +
|
||||
strip_epoch(self._version) + ".lintian")
|
||||
Logger.command(cmd + [">", lintian_filename])
|
||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, encoding='utf-8')
|
||||
report = process.communicate()[0]
|
||||
report = subprocess.check_output(cmd, encoding='utf-8')
|
||||
|
||||
# write lintian report file
|
||||
lintian_file = open(lintian_filename, "w")
|
||||
|
Loading…
x
Reference in New Issue
Block a user