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

split('\n') communicate()'s stdout

parent 58966f1b
No related branches found
Tags debian/2.6.5-9
No related merge requests found
......@@ -118,8 +118,7 @@ def guess_dependency(req, version=None):
'or your upstream author to fix requires.txt')
return set() # should we sys.exit(1) here?
req_dict = req_dict.groupdict()
name = req_dict['name'].lower()
details = data.get(name)
details = data.get(req_dict['name'].lower())
if details:
for item in details:
if version not in item.get('versions', version):
......@@ -157,7 +156,9 @@ def guess_dependency(req, version=None):
exit(8)
result = set()
for line in stdout:
for line in stdout.split('\n'):
if not line.strip():
continue
result.add(line.split(':')[0])
if len(result) > 1:
log.error('more than one package name found for %s dist', name)
......
......@@ -91,8 +91,7 @@ def get_package_files(package_name):
if process.returncode != 0:
log.error('cannot get content of %s', package_name)
sys.exit(2)
for line in stdout:
line = line.strip('\n')
for line in stdout.split('\n'):
if line.endswith('.py'):
yield line
......
......@@ -26,8 +26,8 @@ from __future__ import with_statement
import logging
import optparse
import sys
from os import environ, listdir, mkdir, walk
from os.path import abspath, dirname, exists, isdir, isfile, join
from os import environ, listdir, walk
from os.path import abspath, exists, isdir, isfile, join
from subprocess import PIPE, Popen
sys.path.insert(1, '/usr/share/python/')
from debpython.version import SUPPORTED, debsorted, vrepr, \
......@@ -74,8 +74,7 @@ def get_package_files(package_name):
if process.returncode != 0:
log.error('cannot get content of %s', package_name)
exit(2)
for line in stdout:
line = line.strip('\n')
for line in stdout.split('\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