Blob Blame Raw
From c20812a1fda1f71a70b2be0d643988723a48fdb9 Mon Sep 17 00:00:00 2001
From: Alec Leamas <leamas.alec@gmail.com>
Date: Thu, 9 Jan 2014 20:19:52 +0100
Subject: [PATCH 2/3] deps: Handle malformed output from rpm, part 2 (bz
 #1049042

Kudos: Orion Poplawski
---
 src/FedoraReview/deps.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/FedoraReview/deps.py b/src/FedoraReview/deps.py
index 5bdc462..4dce8ba 100644
--- a/src/FedoraReview/deps.py
+++ b/src/FedoraReview/deps.py
@@ -184,7 +184,11 @@ def listpaths(pkg_filename):
             line = rpm.stdout.next().strip()
         except StopIteration:
             return dirs, files
-        path, mode = line.rsplit(None, 10)[0:5:4]
+        try:
+            path, mode = line.rsplit(None, 10)[0:5:4]
+        except ValueError:
+            # E. g., when given '(contains no files)'
+            continue
         mode = int(mode, 8)
         if mode & 040000:
             dirs.append(path)
-- 
1.8.4.2