I don't see anything that would ever clear the lines you're appended to fastaseq
after finishing a line from your blast file. Try this:
with open(fastaname,'r') as fastafile:
with open(blastfilename,'r') as blastfile:
for line in blastfile:
fastaseq = '' # or whatever data type this is
while True:
fastaline = fastafile.readline()[:-1]
if fastaline[0]=='>':
break
fastaseq += fastaline
somefunction(line,fastaseq)
As it is your first blast line would get the first set of fasta lines, the second blast line would get the first and second sets, etc etc.