From 4dbd1edf115b04a9b149d46595753543ef7d6e23 Mon Sep 17 00:00:00 2001 From: ssstvinc2 Date: Sun, 12 Feb 2017 11:24:31 -0500 Subject: Bug fix for try/except error catching --- unbiasedFunctions.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/unbiasedFunctions.py b/unbiasedFunctions.py index 8caa919..e7ba4b4 100644 --- a/unbiasedFunctions.py +++ b/unbiasedFunctions.py @@ -184,7 +184,9 @@ def printOutputHTML(outputHTML, outFile): def buildNewsSourceArr(sourceList): #build the data structure - for i in range(len(sourceList)): + i=0 + listLen=len(sourceList) + while i < listLen: source=sourceList[i] url=source.url @@ -213,9 +215,12 @@ def buildNewsSourceArr(sourceList): for url in h3s: article=buildArticle(url, source.name) sourceList[i].h3Arr.append(article) + i+=1 else: sourceList.remove(source) - + listLen-=1 + + #return the original sourceList, #since everything should have been modified in place return sourceList -- cgit v1.2.3