Skip to contentSkip to conversation

scanpypi: ignore empty elements in package requirements

PATCH New yegorslists at googlemail.com 2 participants 2 messages Jan 26, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 scanpypi: ignore empty elements in package requirements

From: Yegor Yefremov <[email protected]>

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.

---
Changes v1 -> v2:
- remove debug print statement (Peter Korsgaard)

 utils/scanpypi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
utils/scanpypi +2 -1
index 88fcb4a8a6..23a2fb8c7b 100755
@@ -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)
Signature · 1 line
2.11.0
#1 lore raw

PATCH v2 1/1 scanpypi: ignore empty elements in package requirements

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"yegorslists" == yegorslists <[email protected]> writes:

From: Yegor Yefremov <[email protected]>
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.

Quoted 5 lines

---
Changes v1 -> v2:
- remove debug print statement (Peter Korsgaard)

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard