diff --git a/lib/request/comparison.py b/lib/request/comparison.py index 0966c3695..0be79635e 100644 --- a/lib/request/comparison.py +++ b/lib/request/comparison.py @@ -132,8 +132,15 @@ def _comparison(page, headers, code, getRatioValue, pageLength): seq1 = seq1[count:] seq2 = seq2[count:] - seqMatcher.set_seq1(seq1) - seqMatcher.set_seq2(seq2) + while True: + try: + seqMatcher.set_seq1(seq1) + seqMatcher.set_seq2(seq2) + except MemoryError: + seq1 = seq1[:len(seq1) / 4] + seq2 = seq2[:len(seq2) / 4] + else: + break ratio = round(seqMatcher.quick_ratio(), 3)