path: root/utils/scanpypi
diff options
authorGravatar Yegor Yefremov <yegorslists@googlemail.com>2018-01-26 13:54:06 +0100
committerGravatar Peter Korsgaard <peter@korsgaard.com>2018-01-26 14:43:28 +0100
commit09ec6d7f648cea0229739eff5f7686901c6f76cb (patch)
treeafeb3d42330f58048f6c7fc546668cece06c8492 /utils/scanpypi
parentbb5bb052c60d9ade0e6c4f953edd45820667ae0c (diff)
scanpypi: ignore empty elements in package requirements
Depending on how setup.py reads requirements files empty elements can occur. This patch takes care, that such elements will be ignored and don't crash the scanpypi script. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Tested-by: Matt Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'utils/scanpypi')
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/scanpypi b/utils/scanpypi
index 88fcb4a8a6..23a2fb8c7b 100755
--- a/utils/scanpypi
+++ b/utils/scanpypi
@@ -295,7 +295,8 @@ class BuildrootPackage():
for req in self.pkg_req]
# get rid of commented lines and also strip the package strings
- self.pkg_req = [item.strip() for item in self.pkg_req if item[0] != '#']
+ self.pkg_req = [item.strip() for item in self.pkg_req
+ if len(item) > 0 and item[0] != '#']
req_not_found = self.pkg_req
self.pkg_req = map(pkg_buildroot_name, self.pkg_req)