Skip to content
Snippets Groups Projects
Commit d6ebc7d1 authored by Piotr Ożarowski's avatar Piotr Ożarowski
Browse files

pyclean, pycompile: use .communicate() instead of .wait() to avoid hanging...

pyclean, pycompile: use .communicate() instead of .wait() to avoid hanging `dpkg -L PACKAGE` in few situations
parent 76a61bcb
No related branches found
No related tags found
No related merge requests found
python-defaults (2.6.5-9) UNRELEASED; urgency=low
* pyclean, pycompile: use .communicate() instead of .wait() to avoid hanging
`dpkg -L PACKAGE` in few situations
-- Piotr Ożarowski <piotr@debian.org> Sat, 17 Jul 2010 18:58:23 +0200
python-defaults (2.6.5-8) unstable; urgency=low
* Revert:
......
......@@ -85,12 +85,13 @@ def get_files(items):
def get_package_files(package_name):
process = Popen("/usr/bin/dpkg -L %s" % package_name, shell=True, \
stdout=PIPE, stderr=PIPE)
if process.wait() != 0:
process = Popen("/usr/bin/dpkg -L %s" % package_name,\
shell=True, stdout=PIPE)
stdout, stderr = process.communicate()
if process.returncode != 0:
log.error('cannot get content of %s', package_name)
sys.exit(2)
for line in process.stdout:
for line in stdout:
line = line.strip('\n')
if line.endswith('.py'):
yield line
......
......@@ -68,12 +68,13 @@ def get_directory_files(dname):
def get_package_files(package_name):
"""Generate *.py file names available in given package."""
process = Popen("/usr/bin/dpkg -L %s" % package_name, shell=True, \
stdout=PIPE, stderr=PIPE)
if process.wait() != 0:
process = Popen("/usr/bin/dpkg -L %s" % package_name,\
shell=True, stdout=PIPE)
stdout, stderr = process.communicate()
if process.returncode != 0:
log.error('cannot get content of %s', package_name)
exit(2)
for line in process.stdout:
for line in stdout:
line = line.strip('\n')
if line.endswith('.py'):
yield line
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment