summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unbiasedFunctions.py9
1 files 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